编程介的小学生 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 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题