

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
長さ の正整数列 および整数 が与えられます。
次の条件をすべて満たすように、 座標平面上に 個の点 を配置することができるか判定してください。(同じ座標に 個以上の点を配置してもよいです。)
- 点 と点 の距離は ()
- 線分 と線分 のなす角は 度 ()
制約
- 入力される値はすべて整数
入力
入力は以下の形式で標準入力から与えられる。
出力
問題文の条件をすべて満たすように を配置することができる場合は Yes
を、そうでない場合は No
を出力せよ。
入力例 1Copy
3 -1 1 2 1 3
出力例 1Copy
Yes
座標平面に として点を配置したのが以下の図です。これは問題文の条件をすべて満たしています。
入力例 2Copy
5 2 0 2 2 2 2 2
出力例 2Copy
Yes
とすれば問題文の条件をすべて満たすことができます。同じ座標に複数の点を置いてもよいのに注意してください。
入力例 3Copy
4 5 5 1 2 3 4
出力例 3Copy
No
入力例 4Copy
3 2 7 2 7 4
出力例 4Copy
No
入力例 5Copy
10 8 -7 6 10 4 1 5 9 8 6 5 1
出力例 5Copy
Yes
Score : points
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 1Copy
3 -1 1 2 1 3
Sample Output 1Copy
Yes
The figure below shows a placement where , , , and . All conditions in the Problem Statement are satisfied.
Sample Input 2Copy
5 2 0 2 2 2 2 2
Sample Output 2Copy
Yes
Letting , , , , , and satisfies all the conditions. Note that multiple points may be placed at the same coordinates.
Sample Input 3Copy
4 5 5 1 2 3 4
Sample Output 3Copy
No
Sample Input 4Copy
3 2 7 2 7 4
Sample Output 4Copy
No
Sample Input 5Copy
10 8 -7 6 10 4 1 5 9 8 6 5 1
Sample Output 5Copy
Yes