编程介的小学生 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 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题