#6738. [NCPC 2025] Arithmetic Adaptation
[NCPC 2025] Arithmetic Adaptation
[NCPC 2025] Arithmetic Adaptation
题目描述
:::align{center}
Postcard showing a Norwegian by solving Sample 3. Coloured black and white photo, National Library of Norway. :::
Practice does make perfect! You have finally achieved proficiency at the task of adding two small nonzero integers and to compute their sum . Before you move on to studying four-digit numbers, you want to achieve mastery by also understanding the inverse problem: given integer , determine nonzero and such that . None of the numbers may use more than digits.
输入格式
The input consists of:- One line with an integer such that .
输出格式
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
-1
-2 1
3
1 2
0
-999 999
提示
### Explanation of Sample Input 1On input , the output is correct because . Note that many other outputs would also be correct, such as , , or even . On the other hand, the answer would be (because ), and so would (because both and must be nonzero) and (because both and must have at most three digits.) 标签: P14495|数学|2025|Special Judge|枚举|ICPC