#P7249. [BalticOI 2012] 移动网络 (Day1)
[BalticOI 2012] 移动网络 (Day1)
Description
Given a line segment and several points, find the maximum possible distance from a point on the segment to its nearest point among the given points.
Input Format
The first line contains two integers and , meaning there are points in total, and the endpoints of the segment are and .
Each of the next lines contains two integers , describing the coordinates of a point. It is guaranteed that no two points have the same coordinates.
The points are given sorted in increasing order, with the -coordinate as the primary key and the -coordinate as the secondary key.
Output Format
Output the maximum distance.
This problem uses SPJ. Your answer is considered correct if the absolute error between your output and the standard answer does not exceed .
2 10
0 0
11 1
5.545455
Hint
Sample Explanation.
The point with the maximum distance lies at the intersection of the perpendicular bisector of two points and the line segment.
Constraints.
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , , .
Notes.
Translated from BalticOI 2012 Day1 T2. Mobile.
Translated by ChatGPT 5
京公网安备 11011102002149号