P17391 [PacNW 2025] Triangle of Triangles
Description
Audrey's favorite triangle has angles $a_1$, $b_1$, and $c_1$ degrees. Ruan Mei likes exactly two kinds of triangles: one with angles $a_2$, $b_2$, and $c_2$, and one with angles $a_3$, $b_3$, and $c_3$. 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 $T$ ($1\le T\le10^4$), the number of test cases.
Each test case consists of three lines. Line $j$ contains three integers $a_j,b_j,c_j$ satisfying $5\le a_j\le b_j\le c_j\le170$ and $a_j+b_j+c_j=180$. All values are divisible by $5$. 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`.