编程介的小学生 2017-08-28 14:00 采纳率: 20.5%
浏览 719
已采纳

Lift the Slate

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?

Input

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).

Output

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".

Sample Input

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
Sample Output

Yes 0.0000 0.0000
No

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了