pangfengliu / programmingtasks

programming tasks from my courses
68 stars 17 forks source link

Apple Pile #332

Open littlehug opened 6 years ago

littlehug commented 6 years ago

Task Description

You are given two positive integers a and b. They represent the number of apples at top and bottom in apple pile. For example, the following figure indicates the case that a is 2 and b is 4. Now write a program to calculate the total number of apples and the number of apples around the apple pile. For example, the output should be 9 and 8 in the following figure.

figure

Input Format

The input contains only one test case. The first line and the second line of input contains two integers a, b (0 < a < b < 100), representing the number of apples at top and bottom.

Output Format

Print two lines for each test case. The first line contains one integer, representing the total number of apples. The second line also contains one integer, representing the number of apples around the apple pile.

Sample Input

2 
4

Sample Output

9
8