atcoder#ABC259D. [ABC259D] Circumferences
[ABC259D] Circumferences
Score : points
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.
4
0 -2 3 3
0 0 2
2 0 2
2 3 1
-3 3 3
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.
3
0 1 0 3
0 0 1
0 0 2
0 0 3
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.