#P6505. Run Away

    ID: 5495 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>计算几何Special Judge凸包线段相交

Run Away

Description

In the 2D Cartesian coordinate system, there is a rectangle whose bottom-left corner is at (0,0)(0, 0) and top-right corner is at (w,h)(w, h), with its sides parallel to the coordinate axes.

Inside the rectangle, there are nn given points. The coordinates of the ii-th point are (xi,yi)(x_i, y_i).

Please find a point inside the rectangle such that its distance to the nearest given point is as large as possible. You only need to output the value of this distance.

Input Format

The first line contains three integers w,h,nw, h, n.

The next nn lines each contain two integers xi,yix_i, y_i.

Output Format

Output one real number in a single line, representing the maximum possible value of the nearest distance.

Your answer will be considered correct if its absolute error or relative error is within 10610^{-6} of the standard output.

100 100 4
10 10
10 90
90 10
90 90

56.5685424949

3000 3000 4
1200 85
63 2500
2700 2650
2990 100

1601.8805541731

Hint

Sample Explanation 1

The required point is at (50,50)(50, 50), and its distance to the nearest given point is 40256.56854249492380240 \sqrt{2} \approx 56.568542494923802.


Constraints

  • For 50%50\% of the testdata, n50n \le 50.
  • For 100%100\% of the testdata, 1w,h10 0001 \le w, h \le 10\ 000, 3n10003 \le n \le 1000, 0xiw0 \le x_i \le w, 0yih0 \le y_i \le h.

The input may contain duplicate points.


Source: IOI 2006 CTT paper, "Wang Dong — A Brief Analysis of the Construction and Applications of Planar Voronoi Diagrams".

Translated by ChatGPT 5