#P4636. [SHOI2011] 直线拟合
[SHOI2011] 直线拟合
Description
There are points on the plane. Find the minimum possible value of , where the variable is a line on the plane, and denotes the distance between the line and the point .
Input Format
The first line contains a positive integer . The next lines each contain a pair of integers , separated by a space, representing the coordinates of the points in order. Here , and no two points coincide.
Output Format
Output a single line containing a real number, the minimum value of , rounded to two decimal places.
6
1 0
2 0
3 0
3 2
4 0
5 0
1.00
6
-2 -1
-1 2
1 2
2 3
3 3
4 4
0.86
Hint
Sample Explanation 1
In sample , when the minimum is achieved, the line is .
Sample Explanation 2
In sample , the points and the line when reaches its minimum are shown in the figure.

Constraints and Notes
Test case : .
Test cases : .
Test cases : , and the input file is generated as follows: choose a line segment; each time, first pick a point uniformly at random on the segment, then take the lattice point closest to that point.
Test cases : .
Translated by ChatGPT 5
京公网安备 11011102002149号