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

27488번 - Sum of Two Numbers 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB (추가 메모리 없음)36817415658.427%

문제

The sum of digits of a non-negative integer $a$ is the result of summing up its digits together when written in the decimal system. For example, the sum of digits of 123ドル$ is 6ドル$ and the sum of digits of 10ドル$ is 1ドル$.

In a formal way, the sum of digits of $\displaystyle a=\sum_{i=0}^{\infty} a_i \cdot 10^i,ドル where 0ドル \leq a_i \leq 9,ドル is defined as $\displaystyle\sum_{i=0}^{\infty}{a_i}$.

Given an integer $n,ドル find two non-negative integers $x$ and $y$ which satisfy the following conditions.

  • $x+y=n,ドル and
  • The sum of digits of $x$ and the sum of digits of $y$ differ by at most 1ドル$.

It can be shown that such $x$ and $y$ always exist.

입력

Each test contains multiple test cases. The first line contains the number of test cases $t$ (1ドル \le t \le 10,000円$).

Each test case consists of a single integer $n$ (1ドル \leq n \leq 10^9$)

출력

For each test case, print two integers $x$ and $y$.

If there are multiple answers, print any.

제한

예제 입력 1

5
1
161
67
1206
19

예제 출력 1

1 0
67 94
60 7
1138 68
14 5

In the second test case, the sum of digits of 67ドル$ and the sum of digits of 94ドル$ are both 13ドル$.

In the third test case, the sum of digits of 60ドル$ is 6ドル,ドル and the sum of digits of 7ドル$ is 7ドル$.

힌트

출처

Contest > Codeforces > Codeforces Round 851 (Div. 2) B번

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

출처

대학교 대회

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

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