아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Sum of Two Numbers

면접 대비

시간 제한1초메모리 제한1024 MB

요약
각 n을 자릿수의 합 차이가 1 이하가 되도록 음이 아닌 두 정수 x와 y로 나눈다.
난이도

보통10점 중 4점

유형
그리디, 수학, 구현, 정수론
정답자
아직 제출이 없습니다

문제

The sum of digits of a non-negative integer aa is the result of summing up its digits together when written in the decimal system. For example, the sum of digits of 123123 is 66 and the sum of digits of 1010 is 11.

In a formal way, the sum of digits of a=∑_i=0∞a_i⋅10i\displaystyle a=\sum\_{i=0}^{\infty} a\_i \cdot 10^i, where 0≤a_i≤90 \leq a\_i \leq 9, is defined as ∑_i=0∞a_i\displaystyle\sum\_{i=0}^{\infty}{a\_i}.

Given an integer nn, find two non-negative integers xx and yy which satisfy the following conditions.

  • x+y=nx+y=n, and
  • The sum of digits of xx and the sum of digits of yy differ by at most 11.

It can be shown that such xx and yy always exist.

입력

Each test contains multiple test cases. The first line contains the number of test cases tt (1≤t≤10,0001 \le t \le 10\\,000).

Each test case consists of a single integer nn (1≤n≤1091 \leq n \leq 10^9)

출력

For each test case, print two integers xx and yy.

If there are multiple answers, print any.

예제1

  1. 예제 1

    입력
    5
    1
    161
    67
    1206
    19
    
    예상 출력
    1 0
    67 94
    60 7
    1138 68
    14 5