eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Most Distant Point from the Sea

Most Distant Point from the Sea

The main land of Japan called Honshu is an island surrounded by the sea. In such an island, it is natural to ask a question: "\textit{Where is the most distant point from the sea?}" The answer to this question for Honshu was found in \textbf{1996}. The most distant point is located in former Usuda Town, Nagano Prefecture, whose distance from the sea is \textbf{114.86} km. In this problem, you are asked to write a program which, given a map of an island, finds the most distant point from the sea in the island, and reports its distance from the sea. In order to simplify the problem, we only consider maps representable by convex polygons. \InputFile The input consists of multiple datasets. Each dataset represents a map of an island, which is a convex polygon. The format of a dataset is as follows. \textbf{n} \textbf{x_1 y_1} \textbf{...} \textbf{x_n y_n} Every input item in a dataset is a non-negative integer. Two input items in a line are separated by a space. \textbf{n} in the first line is the number of vertices of the polygon, satisfying \textbf{3} ≤ \textbf{n} ≤ \textbf{100}. Subsequent \textbf{n} lines are the \textbf{x}- and \textbf{y}-coordinates of the \textbf{n} vertices. Line segments (\textbf{x_i}, \textbf{y_i})--(\textbf{x_\{i+1\}}, \textbf{y_\{i+1\}}) (\textbf{1} ≤ \textbf{i} ≤ \textbf{n−1}) and the line segment (\textbf{x_n}, \textbf{y_n})--(\textbf{x_1}, \textbf{y_1}) form the border of the polygon in counterclockwise order. That is, these line segments see the inside of the polygon in the left of their directions. All coordinate values are between \textbf{0} and \textbf{10000}, inclusive. You can assume that the polygon is simple, that is, its border never crosses or touches itself. As stated above, the given polygon is always a convex one. The last dataset is followed by a line containing a single zero. \OutputFile For each dataset in the input, one line containing the distance of the most distant point from the sea should be output. An output line should not contain extra characters such as spaces. The answer should not have an error greater than \textbf{0.00001} (\textbf{10^\{−5\}}). You may output any number of digits after the decimal point, provided that the above accuracy condition is satisfied.
Лимит времени 5 секунд
Лимит использования памяти 64 MiB
Входные данные #1
4
0 0
10000 0
10000 10000
0 10000
3
0 0
10000 0
7000 1000
6
0 40
100 20
250 40
250 70
100 90
0 70
3
0 0
10000 10000
5000 5001
0
Выходные данные #1
5000.000000
494.233641
34.542948
0.353553
Источник ACM ICPC Japan Regional 2007