問題一覧 > 通常問題

No.3209 Cherry Calculation

レベル : / AI推定難易度 : 73 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 168
作問者 : yuusaan / テスター : 👑 loop0919 lif4635 Cafe1942
お気に入りにしたユーザー ProblemId : 12443 / 自分の提出
問題文最終更新日: 2025-07-25 21:11:40
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 475 (ゆるCafe) (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。