#abc274d. D - Robot Arms 2
D - Robot Arms 2
Score : points
问题描述
给定一个包含正整数的序列 ,其长度为 ,以及两个整数 和 。
判断是否可以在 坐标平面上放置 个点 ,满足以下所有条件。允许将两个或多个点放在相同的坐标位置。
- 。
- 。
- 。
- 点 和 之间的距离为 。()
- 线段 和 形成一个 度角。()
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a sequence of length consisting of positive integers, and integers and .
Determine whether it is possible to place points in the -coordinate plane to satisfy all of the following conditions. (It is allowed to place two or more points at the same coordinates.)
- .
- .
- .
- The distance between the points and is . ()
- The segments and form a degree angle. ()
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
If it is possible to place to satisfy all of the conditions in the Problem Statement, print Yes
; otherwise, print No
.
Sample Input 1
3 -1 1
2 1 3
Sample Output 1
Yes
The figure below shows a placement where , , , and . All conditions in the Problem Statement are satisfied.
Sample Input 2
5 2 0
2 2 2 2 2
Sample Output 2
Yes
Letting , , , , , and satisfies all the conditions. Note that multiple points may be placed at the same coordinates.
Sample Input 3
4 5 5
1 2 3 4
Sample Output 3
No
Sample Input 4
3 2 7
2 7 4
Sample Output 4
No
Sample Input 5
10 8 -7
6 10 4 1 5 9 8 6 5 1
Sample Output 5
Yes
update @ 2024/3/10 11:32:49