GlobeX Cup '18 J1 - Rounding Errors

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Problem type

Lancrize has just been hired to be a science teacher. In order to do science stuff, he has to do some stuff with equations and round some random numbers. He will round up if the decimal point after the number is above or equal to .5. If the decimal point after the number is strictly below .5, he will round down. Output the number of times he rounds up and down.

Rounding .0 is considered rounding down.

Input Specification

The first line will contain a single integer N\ (1 \le N \le 2 \times 10^5), the number of times Lancrize has to round.

The next N lines will contain a single floating-point number X\ (1 \le X \le 10^5), the value of the number he is trying to round. It is guaranteed X will not contain more than 5 digits after the decimal point.

Output Specification

Output on the first line the number of times Lancrize rounds up, and the second line the number of time Lancrize rounds down.


Subtask 1 [30%]

N \le 100

Subtask 2 [70%]

No additional constraints.

Sample Input


Sample Output


Explanation For Sample

Lancrize has to round up for 4.823, and rounds down for 1.31, 4.34, 2.1, 10.215.


There are no comments at the moment.