One of the most disastrous nuclear accidents in history has taken place at Japan's Fukushima Daiichi nuclear plant. Reactor buildings have been rocked by explosions, caused after damage was sustained from a massive earthquake and tsunami on 11th march and thus releasing dangerous radiation of unspecified proportions into the air.
The radiation is spreading and it's not a threat only to Japan but also to other countries. If the level of radiation reaches a high level, it will surely cause harms to human health as well as the environment.
You, one of the great programmers in the city, have planned to find the zones that are vulnerable to radiation. If you can measure the level of radiation in a certain city, further actions can be taken to prevent the people from radiation related health consequences. So, at first you want to find the time in which a certain percentage of an area is under radiation threat.
So, at first you modeled the map of a city in 2D space as a simple polygon [1]. You denoted the origin of the explosion as a single point. From this origin, the radiation spreads circularly. You plotted the map such that in each unit of time the radius of the radiation grows one unit. Now, you want to find the time when P% of the area of a city is under threat of radiation.
Input
Input starts with an integer T (≤ 70), denoting the number of test cases.
Each test case starts with a blank line. The next line contains an integer n (3 ≤ n ≤ 5000) denoting the number of vertices of the polygon. Each of the next n lines will contain two integers xi, yi denoting the co-ordinate of a vertex of the polygon. The vertices will be given in anti-clockwise order. The next line contains 3 integers rx, ry and P (0 < P ≤ 100), where (rx, ry) denotes the co-ordinate of the origin of explosion and P denotes the percentage. All values for the co-ordinates are between -200 to 200 (inclusive).
Output
For each case, print the case number and the time when exactly P% of the total area is under threat of radiation. Round the time to the nearest integer.
Sample
Sample Input | Sample Output |
---|---|
2 3 -5 0 5 0 0 5 0 0 100 4 0 0 5 0 3 1 5 6 0 0 17 | Case 1: 5 Case 2: 2 |
Notes
- In geometry, a simple polygon is a closed polygonal chain of line segments in the plane which do not have points in common other than the common vertices of pairs of consecutive segments.
- The judge data is prepared such that the result (before rounding) will not be between x.3 to x.7. For example, the result can be like 5.8, 24.3 or 81.791. But the result will not be like 24.5, 78.4, etc.