编程介的小学生 2017-08-28 14:00 采纳率: 18.6%
浏览 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 微信实时共享位置修改
    • ¥100 TG的session协议号转成直登号号后客户端登录几分钟后自动退出设备
    • ¥30 共模反馈回路的小信号增益
    • ¥15 arduino ssd1306函数与tone函数放歌代码不兼容问题
    • ¥70 0.96版本hbase的row_key里含有双引号,无法deleteall
    • ¥20 Ida Pro增加插件出现问题
    • ¥15 诊断性META分析合并效能的检验
    • ¥15 请问abb根据色块判断奇偶数并根据批次号放入仓储
    • ¥66 开发PC客户端一定也要开发上位机吗?
    • ¥20 Java eclipse连接数据库