302299: CF442E. Gena and Second Distance

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Gena and Second Distance

题意翻译

问题描述:吉纳不喜欢几何,所以他请求你为他解决这个问题。 一个边平行坐标轴的矩形包含n 个点。让我们考虑从矩形内任一点出发,计算从这一点到给出的n 个点的距离。将这些距离从小到大排序,我们称排序后的第二个值为这个点的美丽值。如果最小的两个距离相等,那么美丽值等于最小值。 找到矩形内任意点最大的美丽值。 输入:第一行包含三个整数w, h, n(1 <= w, h <= 10^6; 2 <= n <= 1000)——矩形两条边的长度和所包含的点的数目。接下来n 行每行包含两个整数xi, yi(0 <= xi <=w; 0 <= yi <= h)表示一个点的坐标。重合的两个点是可能出现的。 输出:单独一个整数——所有点中最大的美丽值。答案被视为正确当且仅当绝对或相对误差不大于1e-9。

题目描述

Gena doesn't like geometry, so he asks you to solve this problem for him. A rectangle with sides parallel to coordinate axes contains $ n $ dots. Let's consider some point of the plane. Let's count the distances from this point to the given $ n $ points. Let's sort these numbers in the non-decreasing order. We'll call the beauty of the point the second element of this array. If there are two mimimum elements in this array, the beaty will be equal to this minimum. Find the maximum beauty of a point inside the given rectangle.

输入输出格式

输入格式


The first line contains three integers $ w,h,n $ ( $ 1<=w,h<=10^{6},2<=n<=1000 $ ) — the lengths of the rectangle sides and the number of points. Next $ n $ lines contain two integers $ x_{i},y_{i} $ ( $ 0<=x_{i}<=w,0<=y_{i}<=h $ ) each — the coordinates of a point. It is possible that it will be coincident points.

输出格式


Print a single number — the maximum beauty of a point with the absolute or relative error of at most $ 10^{-9} $ .

输入输出样例

输入样例 #1

5 5 4
0 0
5 0
0 5
5 5

输出样例 #1

4.99999999941792340

输入样例 #2

5 5 3
4 0
2 5
4 1

输出样例 #2

5.65685424744772010

说明

The point which beauty we need to find must have coordinates ( $ x,y $ ), where $ 0<=x<=w,0<=y<=h $ . Some of the $ n $ points can coincide.

Input

题意翻译

问题描述:吉纳不喜欢几何,所以他请求你为他解决这个问题。 一个边平行坐标轴的矩形包含n 个点。让我们考虑从矩形内任一点出发,计算从这一点到给出的n 个点的距离。将这些距离从小到大排序,我们称排序后的第二个值为这个点的美丽值。如果最小的两个距离相等,那么美丽值等于最小值。 找到矩形内任意点最大的美丽值。 输入:第一行包含三个整数w, h, n(1 <= w, h <= 10^6; 2 <= n <= 1000)——矩形两条边的长度和所包含的点的数目。接下来n 行每行包含两个整数xi, yi(0 <= xi <=w; 0 <= yi <= h)表示一个点的坐标。重合的两个点是可能出现的。 输出:单独一个整数——所有点中最大的美丽值。答案被视为正确当且仅当绝对或相对误差不大于1e-9。

加入题单

算法标签: