#P6947. Wireless Coverage of the Great Panda National Park

    ID: 20154 Type: Default 1000ms 256MiB

Wireless Coverage of the Great Panda National Park

Wireless Coverage of the Great Panda National Park

In the Great Panda National Park project, a polygonal fence encloses a natural preserve that houses over (1800) giant pandas. Wireless receivers are installed at each vertex of the fence, and each receiver covers a circular area with an identical radius. In order to minimize cost, it is desired to use the smallest possible range (R) such that the union of all circles (with centers at the polygon vertices) completely covers the park. In other words, let the park be represented by a simple polygon (D) with vertices (v_1, v_2, \ldots, v_n). For any point (P \in D) define [ f(P)=\min_{1 \le i \le n} ; d(P,v_i), ] where (d(P,v_i)) is the Euclidean distance between (P) and vertex (v_i). Your task is to compute [ R^* = \max_{P \in D} f(P). ] This is exactly the smallest range required so that if circles with radius (R^) are drawn around each vertex, the entire park is covered. Note that if (R < R^) there exists at least one point in the park that is not within range of any receiver.

It is guaranteed that the polygon is simple (its edges do not cross) and may be convex or concave.

Example: Consider the polygon with vertices (0,0), (60,0) and (0,80) (a right triangle). The point \(P = (30,40)\) is equidistant from all vertices with \(d(P,(0,0))=d(P,(60,0))=d(P,(0,80))=50\), and one may verify that \(50\) is the smallest range that covers the whole polygon.

inputFormat

The first line contains an integer \(n\) (\(3 \le n \le 10^5\)), the number of vertices of the polygon. The following \(n\) lines each contain two real numbers representing the \(x\) and \(y\) coordinates of the vertices (in order, either clockwise or counter‐clockwise).

outputFormat

Output a single line with a real number \(R^*\) (with an absolute or relative error of at most \(10^{-6}\)) representing the smallest required wireless range so that the union of circles centered at the vertices with radius \(R^*\) completely covers the park.

sample

4
0 0
0 100
100 100
100 0
70.710678