Calculation
InterviewTime limit2sMemory limit1024 MB
Given two integers A and B, print the larger and then the smaller of A+B and A-B.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Two integers A and B are given. Print the maximum and the minimum of A+B and A-B, in that order.
Input
Input is given from standard input in the following format.
A B
Output
The output consists of 2 lines.
On line 1, print the maximum of A+B and A-B.
On line 2, print the minimum of A+B and A-B.
Constraints
-100 ≤ A ≤ 100.-100 ≤ B ≤ 100.