Given n points in x-y plane, find a circle with minimum radius that encloses all n points (that is, all n points lie within or on the border of the circle).
Don't assume anything (such as no three points are collinear, no four points share an circumcircle... etc), the testcase can be unkind.
There are multiple testcase, input is terminated by EOF.
Each testcase starts with an integer N (1<=N<=100000), denoting the number of points. The following N lines each contain a pair of number (not necessarily integer) that represents the coordinate of a point. 0 <= |xi|, |yi| <= 100000.
For each testcase output a single line containing the radius of the minimum enclosing circle.
Note that it is okay for some point to lie on the border of the circle, and a circle with radius 0 is considered legal.
Your output would be considered correct if it is within an error of 10-6.
6 2.35 4.72 1.41 5.78 -2.34 -7.21 3.44 1.23 0.23 -2.21 0.45 9.98
8.70747093
Info: 本題輸出為浮點數,絕對或相對誤差 1e-6 以下視為正確
Migrated from old NTUJ.
classic
No. | Testdata Range | Score |
---|