Most distant point from the sea
Time Limit: 5000MS |
|
Memory Limit: 65536K |
Total submissions: 5136 |
|
accepted: 2323 |
|
Special Judge |
Description The main land of the Japan called Honshu is a island surrounded by the sea. In such an island, it's natural to ask a question: "Where's the most distant point from the sea?" The answer to this question for Honshu is found in 1996. The most distant point are located in former Usuda Town, Nagano Prefecture, whose distance to the ' sea ' is 114.86 km. In this problem, your are asked to write a program which, given a map of a island, finds the most EA in the island, and reports its distance to the sea. In order to simplify the problem, we have consider maps representable by convex polygons. Input The input consists of multiple datasets. Each dataset represents a map of the island, which is a convex polygon. The format of a dataset is as follows.
Every input item in a dataset is a non-negative integer. Two input items in a line are separated by a space. N in the ' The ' of the # of vertices of the polygon, satisfying 3≤n≤100. Subsequent n lines are the X-and y-coordinates of the n vertices. Line segments (xi, Yi)-(xi+1, yi+1) (1≤i≤n−1) and the line segment (xn, yn) – (x1, y1) Form the border of the polygon In counterclockwise order. This is the inside of the "polygon in the" the left of their directions of the segments. All coordinate values are between 0 and 10000, inclusive. You can assume this polygon is simple, which is, its border never crosses or touches itself. As stated above, the given polygon is always a convex one. The last dataset was followed by a line containing a single zero. Output For each dataset in the input, one line containing the distance of the the most distant point from the sea should to be output. An output line should not contain extra characters such as spaces. The answer should not have a error greater than 0.00001 (10−5). You could output any number of digits to the decimal point, provided this above accuracy condition is satisfied. Sample Input 4
0 0
10000 0
10000 10000
0 10000
3 0 0
10000 0 7000
1000
6
0/
100 20< c11/>250
0
3
0 0
10000 10000
5000 5001
0 Sample Output 5000.000000
494.233641
34.542948
0.353553 Source Japan 2007 |