#P17391. [PacNW 2025] Triangle of Triangles
[PacNW 2025] Triangle of Triangles
Problem Description
Audrey's favorite triangle has angles , , and degrees. Ruan Mei likes exactly two kinds of triangles: one with angles , , and , and one with angles , , and . The order of the angles does not matter.
Audrey wants to draw a segment from one vertex of her triangle to the opposite side, cutting the triangle into two smaller triangles. Determine whether both resulting triangles can be kinds that Ruan Mei likes.
Input Format
The first line contains an integer (), the number of test cases.
Each test case consists of three lines. Line contains three integers satisfying and . All values are divisible by . The two triangle types Ruan Mei likes are distinct.
Output Format
For each test case, output YES if one cut can produce two triangles Ruan Mei likes. Otherwise, output NO.
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
YES
NO
YES