Problem F
Næstbest
Languages
en
is
The University of Iceland is estimating how long it takes to walk between classrooms to make sure students have enough time between classes to get around. In a prior contest we asked you to find the worst case, this will not be required again. The question now is what the best cases are. You should find the two buildings that are the closest and the two buildings that are the second closest.
Input
The first line of the input is a single integer
Output
Print two lines. The first containing the distance between
the closest buildings. The second containing the distance
between the second closest buildings. Your answers should be
correct within absolute or relative error less than
Sample Input 1 | Sample Output 1 |
---|---|
5 0.0 0.0 1.0 2.0 2.0 2.0 3.0 0.0 3.0 3.0 |
1.0000000000 1.4142135624 |
Sample Input 2 | Sample Output 2 |
---|---|
5 1.0 0.0 0.0 1.0 1.0 1.0 2.0 1.0 1.0 2.0 |
1.0000000000 1.0000000000 |