65. Sum and Difference (hard version, 200 points)

Time Limit: 1 seconds

Memory Limit: 1024 MB

Rating: 1000

Problem Statement

I am thinking of 2 integers $A$ and $B$. The first integer given is the sum $(A+B)$ and the second is the difference $(A-B)$. Output the 2 numbers I'm thinking of on separate lines.

Input

The first line has the value of $A+B$. The second line has the value of $A-B$.

Output

On the first line, output $A$. On the second line, output $B$. Note: Make sure that $A \le B$ when outputting, otherwise your solution may be marked incorrect.

Sample Cases
Sample Input 1:
3
1

Sample Output 1:
2
1
Explanation

$2 + 1 = 3$ $2 - 1 = 1$

Sources

IanOJ Contest #2 (Div. 4) > Problem D2 (Contributed by bronze@HungJan@)

Submit | Back