Logo
(追記) (追記ここまで)

28202번 - Classical A+B Problem 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 1024 MB246816336.628%

문제

An integer is called a repdigit if it is positive and its decimal representation consists of repeated instances of the same digit. For example, 1ドル,ドル 666ドル,ドル 4444ドル,ドル and 999999ドル$ are repdigits, while 0ドル,ドル 44244ドル,ドル 50216ドル,ドル and 787788ドル$ are not.

You are given a positive integer $n$. It is known that $n$ can be represented as $n = a + b,ドル where $a$ and $b$ are repdigits. Find any such representation.

입력

Each test contains multiple test cases. The first line contains the number of test cases $t$ (1ドル \le t \le 10^4$). The description of the test cases follows.

The only line of each test case contains a single integer $n$ without leading zeros (2ドル \le n < 10^{4000}$). It is guaranteed that $n$ can be represented as $n = a + b,ドル where $a$ and $b$ are repdigits.

It is guaranteed that the total number of digits in $n$ over all test cases does not exceed 10ドル^5$.

출력

For each test case, print two integers $a$ and $b$ such that $n = a + b$ and both $a$ and $b$ are repdigits.

If there are multiple solutions, print any of them.

제한

예제 입력 1

6
2
786
1332
89110
2333333
10000000000000000000000000001

예제 출력 1

1 1
777 9
333 999
88888 222
2222222 111111
9999999999999999999999999999 2

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2023 > Day 7: Gennady Korotkevich Contest 7 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /