#abc259d. D - Circumferences
D - Circumferences
Score : points
问题描述
给定在 坐标平面上的 个圆。对于每个 ,第 个圆以点 为中心,半径为 。
确定是否可以从点 到达点 ,且仅通过至少位于这 个圆之一的圆周上的点。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given circles on the -coordinate plane. For each , the -th circle is centered at and has a radius of .
Determine whether it is possible to get from to by only passing through points that lie on the circumference of at least one of the circles.
Constraints
- lies on the circumference of at least one of the circles.
- lies on the circumference of at least one of the circles.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If it is possible to get from to , print Yes
; otherwise, print No
. Note that the judge is case-sensitive.
Sample Input 1
4
0 -2 3 3
0 0 2
2 0 2
2 3 1
-3 3 3
Sample Output 1
Yes
Here is one way to get from to .
- From , pass through the circumference of the -st circle counterclockwise to reach .
- From , pass through the circumference of the -nd circle clockwise to reach .
- From , pass through the circumference of the -rd circle counterclockwise to reach .
Thus, Yes
should be printed.
Sample Input 2
3
0 1 0 3
0 0 1
0 0 2
0 0 3
Sample Output 2
No
It is impossible to get from to by only passing through points on the circumference of at least one of the circles, so No
should be printed.
update @ 2024/3/10 10:59:35