A - Plus Minus
Editorial
/


Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 100 点
問題文
高橋君は 2 つの整数 X, Y を持っています。
X + Y と X - Y を計算した結果、A と B になりました。
高橋君は計算後に X と Y を忘れてしまったので、X と Y を求めてあげてください。
制約
- -100 \leq A, B \leq 100
- 与えられる A, B に対して X + Y = A, X - Y = B を満たす整数 X, Y が一意に存在する
- 入力は全て整数である
入力
入力は以下の形式で標準入力から与えられる。
A B
出力
X と Y を出力せよ。
入力例 1
2 -2
出力例 1
0 2
X = 0, Y = 2 とすると 0 + 2 = 2, 0 - 2 = -2 で辻褄が合います。
入力例 2
3 1
出力例 2
2 1
Score : 100 points
Problem Statement
Takahashi has two integers X and Y.
He computed X + Y and X - Y, and the results were A and B, respectively.
Now he cannot remember what X and Y were. Find X and Y for him.
Constraints
- -100 \leq A, B \leq 100
- For the given integers A and B, there uniquely exist integers X and Y such that X + Y = A and X - Y = B.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
A B
Output
Print X and Y.
Sample Input 1
2 -2
Sample Output 1
0 2
If X = 0 and Y = 2, they match the situation: 0 + 2 = 2 and 0 - 2 = -2.
Sample Input 2
3 1
Sample Output 2
2 1