CCO '08 P6 - Landing

View as PDF

Submit solution

Points: 45
Time limit: 2.5s
Memory limit: 512M

Problem type
Canadian Computing Competition: 2008 Stage 2, Day 2, Problem 3

Keep watching the skies! Alien spacecraft are due to land any day now to share all of their advanced programming secrets with us.

In preparation for this day, you've been tasked with preparing a landing pad for our visitors in a given field. Unfortunately, due to environmental considerations, you will not be permitted to remove any of the trees which currently exist on the field. These trees are of immense scientific interest, since they have zero radius and only grow at points with integer coordinates. However, this could be a blessing in disguise. For security reasons, the landing pad must be in contact with at least three trees. Security cameras will be placed at the tops of these trees.

Alien spacecraft are perfectly circular craft of various sizes, so the landing pad will also be circular. Since it would be polite to warn potential visitors ahead of time if their spacecraft is too large for our landing pad, you must now determine the size of the largest circular region that we can place on the field which contacts at least three trees, but does not contain any trees within.

Input Specification

The first line of input will consist of the number n of trees (3 \le n \le 100\,000). The next n lines will each consist of a pair of integers x and y (-10\,000 \le x, y \le 10\,000), separated by a space, giving the coordinates of a tree. You may assume that no two trees are at the same coordinate.

Output Specification

Output the radius of the largest possible landing pad. If the correct answer is R, you should output any number a such that

\displaystyle \frac R {1 + 10^{-4}}< a < R(1 + 10^{-4})

The above calculation is used to define an acceptable range or tolerance for the answer you find. You may also assume that R < 10^9. You may assume there exists at least one landing pad.

Sample Input

4
1 1
1 -1
-1 -1
-1 1

Sample Output

1.41421356

Grading

You may assume that 25\% of the test cases will have at most 50 trees. You may assume that 95\% of the test cases will have at most 1\,000 trees. All test cases will have at most 100\,000 trees.


Comments

There are no comments at the moment.