| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 107 | 66 | 52 | 63.415% |
Practice does make perfect! You have finally achieved proficiency at the task of adding two small nonzero integers $a$ and $b$ to compute their sum $a+b$. Before you move on to studying four-digit numbers, you want to achieve mastery by also understanding the inverse problem: given integer $s$, determine nonzero $a$ and $b$ such that $a+b=s$. None of the numbers may use more than $3$ digits.
The input consists of:
Output two integers $a$ (with $-999\leq a\leq 999$ and $a\neq 0$) and $b$ (with $-999\leq b\leq 999$ and $b\neq 0$) such that $a+b=s$. If there is more than one valid solution, you may output any one of them.
10
3 7
On input "10", the output "3 7" is correct because $3+7=10$. Note that many other outputs would also be correct, such as "2 8", "11 -1", or even "-849 859". On the other hand, the answer "4 7" would be wrong (because $4+7\neq 10$), and so would "10 0" (because both $a$ and $b$ must be nonzero) and "1000 -990" (because both $a$ and $b$ must have at most three digits.)
-1
-2 1
3
1 2
0
-999 999
ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2025 A번