To scientifically round a real number, find the integer that is the closest to the real number. If there are two equally close integers, choose the even integer. A few examples are listed in the table below.
Real number | Rounded value | Comment |
---|---|---|
In the remainder of the problem statement,
Percentages may not add up to 100% due to rounding.
Wilson is learning about how to scientifically round numbers to the nearest integer on the first day of his physics class. A little later, Wilson is trying out some easy physics problems; he adds up a bunch of distances and scientifically rounds the sum. Sometimes Wilson wonders about the accuracy of his results.
On his next problem, he needs to add together
What is the minimum and maximum possible answer to the physics problem?
Constraints
For
For
If exactly one output is wrong,
Input Specification
The first integer will contain
On each of the next
Output Specification
The first line should contain the minimum possible value of
The second line should contain the maximum possible value of
Each value should be an integer, and do not print the integer with a .
character.
Sample Input 1
1
5
Sample Output 1
5
5
Sample Input 2
2
49
50
Sample Output 2
98
100
Sample Input 3
3
10
10
10
Sample Output 3
28
32
Comments
for sample output 3, doesn't round(28.5)=29, and round(10.5)=11
I got 1 case wrong, and got an 85/100. I got 2 cases wrong and got 90/100. Is this intended?
There are partials for test cases. So it may say AC and say 3/5 on the side instead of 5/5. This means that you only got one of the answers correct.