GlobeX Cup '18 J1 - Rounding Errors

View as PDF

Submit solution


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

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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.

Subtasks

Subtask 1 [30%]

N \le 100

Subtask 2 [70%]

No further constraints.

Sample Input

5
1.31
4.34
2.1
4.823
10.215

Sample Output

1
4

Explanation For Sample

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


Comments

There are no comments at the moment.