Landing
Time limit1sMemory limit128 MB
Given up to 100000 integer points, find the largest circle whose boundary passes through at least three points and whose interior contains none, and output R^2 as a reduced fraction.
- Level
Hard9 of 10
- Topics
- Geometry, Combinatorics, Math, Sorting
- Solved
- No attempts yet
Problem
Keep watching the skies! Alien spacecraft are due to land any day now to share all of their advanced programming secrets with us.
To prepare, you must lay out a circular landing pad in a field. For environmental reasons you may not remove any of the trees already growing there. Each tree has zero radius and grows only at a point with integer coordinates.
For security, the landing pad must touch at least three trees: those trees lie exactly on the boundary circle of the pad, and cameras are mounted on top of them. No tree may lie strictly inside the pad (a tree on the boundary counts as contact, not as being inside).
Spacecraft are perfectly circular, so the landing pad is a circle too. Determine the size of the largest circular pad that can be placed in the field so that its boundary passes through at least three trees while enclosing no tree in its interior.
Input
The first line contains the number of trees ().
Each of the next lines contains two integers and () separated by a space, the coordinates of one tree. No two trees share the same coordinates.
Output
Let be the radius of the largest valid landing pad. Because every tree has integer coordinates, itself is usually irrational, but is always a rational number.
Print as a reduced fraction p/q: two integers separated by a slash, in lowest terms with and . For example, a pad of radius is printed as 25/4.
It is guaranteed that at least one valid landing pad exists and that .