Logo
(追記) (追記ここまで)

34794번 - Triangle of Triangles 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB41401593.750%

문제

Audrey has a favorite triangle. Specifically, the angles of the triangle are $a_1$ degrees, $b_1$ degrees, and $c_1$ degrees.

Ruan Mei only likes two types of triangles. Specifically, she only likes a triangle if the degrees of the three angles are either $a_2$ degrees, $b_2$ degrees, and $c_2$ degrees; or $a_3$ degrees, $b_3$ degrees, and $c_3$ degrees. The order of the angles does not matter.

Audrey and Ruan Mei only like multiples of 5ドル,ドル so it is guaranteed that the degree measures of all of the angles in their favorite triangles are divisible by 5ドル$.

Audrey wants to draw a line segment starting at one vertex of her favorite triangle and ending at the opposite side of that vertex such that, if she cuts the triangle along that line segment, she divides the triangle into two smaller triangles, both of which Ruan Mei likes. Is this possible?

입력

The first line contains a single integer, $T$ (1ドル \le T \le 10^4$). $T$ test cases follow.

The description for each test case spans three lines.

The first line contains three integers, $a_1,ドル $b_1,ドル and $c_1$ (5ドル \le a_1 \le b_1 \le c_1 \le 170, a_1 + b_1 + c_1 = 180$).

The second line contains three integers, $a_2,ドル $b_2,ドル and $c_2$ (5ドル \le a_2 \le b_2 \le c_2 \le 170, a_2 + b_2 + c_2 = 180$).

The third line contains three integers, $a_3,ドル $b_3,ドル and $c_3$ (5ドル \le a_3 \le b_3 \le c_3 \le 170, a_3 + b_3 + c_3 = 180$).

It is guaranteed at least one of $a_2 \neq a_3,ドル $b_2 \neq b_3,ドル or $c_2 \neq c_3$. It is furthermore guaranteed that all of these values are divisible by 5ドル$.

출력

Output $T$ lines. On the $i$th line, output the answer for the $i$th test case.

Output YES if it is possible for Audrey to cut her favorite triangle exactly once to form two triangles, both of which Ruan Mei likes. Otherwise, output NO.

제한

예제 입력 1

3
30 60 90
15 30 135
45 45 90
30 60 90
15 30 135
40 50 90
45 45 90
45 45 90
5 10 165

예제 출력 1

YES
NO
YES

노트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2025 ICPC Pacific Northwest Regional > Division 1 M번

ICPC > Regionals > North America > Pacific Northwest Regional > 2025 ICPC Pacific Northwest Regional > Division 2 M번

  • 문제를 만든 사람: Nick Wu
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /