No.3209 Cherry Calculation
Problem Statement
Cherry calculation is a technique used when adding two positive integers whose sum is a $2$-digit integer: one of the positive integers is split into $2$ positive integers, and the associative law is used to make $10$ appear in the calculation process, which makes the calculation easier.
For example, consider a calculation such as $5+9= 5+(5+4) = 10+4 = 14$.
You are given single-digit positive integers $A,B$. Here, it is guaranteed that $A+B \ge 11$.
Split $B$ so that the cherry calculation works. More strictly, find the pair of positive integers $x,y$ that satisfies all of the following conditions.
- $A+x=10$
- $x+y = B$
Under the constraints, such a pair $x,y$ is uniquely determined.
Input
$A\ B$
Constraints
- $2\le A,B \le 9$
- $A+B\ge 11$
- All inputs are integers.
Output
Print $x,y$ satisfying the conditions in this order on one line, separated by a space, followed by a newline.
Sample
Sample 1
Input
5 9
Output
5 4
If $(x,y)=(5,4)$, then $A+x=5+5=10,x+y=5+4=B$, so the conditions are satisfied.
Sample 2
Input
9 9
Output
1 8
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Cafe1942