Marquette University
High School Programming Contest 2013

Problem #3
Almost An Integer

Given a set of floating point values (type double) determine which value is closest to an integer. For instance, 4.3 is 0.3 units away from an integer (i.e. 4) and 2.8 is 0.2 units away from an integer (i.e. 3). So, given the set 4.3 and 2.8, the program should choose 2.8. If two or more numbers in the set are the same distance from an integer, either is an acceptable answer.

Each set of numbers will begin with an integer saying how many numbers are in the set (on a line by itself). Then the next line will contain the numbers separated by spaces. The end of input is indicated by a set size of zero.

Sample Input

2
4.3 2.8
5
8.3 -43.8 71.17 0.75 26.5
4
111.111 222.222 777.777 333.0
0
Sample Output
2.8
71.17
333.0