Problem C
Meltdown
A polygon is lowered at a constant speed of
The border between air and liquid always has y-coordinate 0, and the liquid only eats away from the sides of the polygon in 2 dimensions. The polygon does not rotate as it is lowered into the liquid, and at time 0, it is not touching the liquid.
Unlike the polygon, which is flat (2-dimensional), the liquid exists in three dimensions. Therefore, the liquid seeps into cavities in the polygon. For example, if the polygon is “cup-shaped”, the liquid can get “inside” the cup, as in the diagram below.

Input
The input consists of several test cases.
The first line of each test case contains the five integers
The following
The vertices of the polygon are given in counter-clockwise
order. The border of the polygon does not intersect or touch
itself, and the point
Input is terminated by a line containing 0 0 0 0 0. These zeros are not a test case and should not be processed.
Output
For each test case, output the first time in minutes that the liquid reaches the specified point, rounded to four decimal places.
Sample Input 1 | Sample Output 1 |
---|---|
4 0 50 2 1 -1 10 1 10 1 90 -1 90 0 0 0 0 0 |
25.8660 |