#P6947. [ICPC2018 WF] Panda Preserve

[ICPC2018 WF] Panda Preserve

题目描述

Last month, Sichuan province secured funding to establish the Great Panda National Park, a natural preserve for a population of more than 18001 800 giant pandas. The park will be surrounded by a polygonal fence. In order for researchers to track the pandas, wireless receivers will be placed at each vertex of the enclosing polygon and each animal will be outfitted with a wireless transmitter. Each wireless receiver will cover a circular area centered at the location of the receiver, and all receivers will have the same range. Naturally, receivers with smaller range are cheaper, so your goal is to determine the smallest possible range that suffices to cover the entire park.

As an example, Figure G.1 shows the park described by the first sample input. Notice that a wireless range of 3535 does not suffice (a) , while the optimal range of 5050 covers the entire park (b) .

Figure G.1 : Illustration of Sample Input 11 .

输入格式

The first line of the input contains an integer n(3n2000)n (3 \le n \le 2 000) specifying the number of vertices of the polygon bounding the park. This is followed by nn lines, each containing two integers xx and y(x,y104)y (|x|, |y| \le 10^{4}) that give the coordinates (x,y)(x , y) of the vertices of the polygon in counter-clockwise order. The polygon is simple; that is, its vertices are distinct and no two edges of the polygon intersect or touch, except that consecutive edges touch at their common vertex.

输出格式

Display the minimum wireless range that suffices to cover the park, with an absolute or relative error of at most 106.10^{−6}.

题目大意

给定一个 nn 个点的不自交的多边形(不一定是凸多边形),求最小的圆半径 rr 使得在每个顶点画一个半径为 rr 的圆,这些圆的并覆盖了整个多边形。n2000n \le 2000,绝对误差或相对误差不超过 10610^{-6}

5
0 0
170 0
140 30
60 30
0 70

50

5
0 0
170 0
140 30
60 30
0 100

51.538820320

5
0 0
1 2
1 5
0 2
0 1

1.581138830

提示

Time limit: 10 s, Memory limit: 1024 MB.