ZOJ Problem Set - 3552
We have a large round slate(stone plate), it is homogeneous and smooth, so we could regard the slate as a perfect cylinder. We use a drill to drill some holes on the slate. Now we want to find a single supporting point to lift the slate with holes, can we find one?
Since we have only one drill, it is easy to know that the holes are all circles with the same radius r. Now give you all the holes' center, can you tell us whether we can find a supporting point to lift the slate?
The input contains multiple test cases. In each test case, the first line contains two real numbers r(0 < r), R(r < R ≤ 1000) and a integer n(0 ≤ n ≤ 200), here r is the holes radius, R is the slate's radius, and n is the number of holes.
Then the following n lines each contains two real numbers represent the x and y coordinates of the corresponding hole's center, we guarantee that all the holes will not cross the slate's edge, which means that every holes is strictly inside the slate. The slate is centered at the origin point (0, 0).
For each test case, if a supporting point to lift the slate can be found (The very point on the edges of the holes or the slate is acceptable), output "Yes" and the x and y coordinates of the supporint point in one line, here the x and y should be rounded to 4 digits after the decimal point; otherwise output "No".
1.0 5.0 4 0.0 2.0 2.0 0.0 0.0 -2.0 -2.0 0.0 0.9 1.0 1 0.01 0.01
Yes 0.0000 0.0000 No
Author: FAN, Yuzhe
Contest: ZOJ Monthly, October 2011