QOJ.ac

QOJ

时间限制: 2.0 s 内存限制: 2048 MB 总分: 100

#14935. Triangle of Triangles

统计

Audrey 有一个最喜欢的三角形。具体来说,这个三角形的三个内角分别为 $a_1$ 度、$b_1$ 度和 $c_1$ 度。

阮梅只喜欢两种类型的三角形。具体来说,只有当一个三角形的三个内角分别为 $a_2$ 度、$b_2$ 度和 $c_2$ 度,或者为 $a_3$ 度、$b_3$ 度和 $c_3$ 度时,她才会喜欢这个三角形。角度的顺序无关紧要。

Audrey 和阮梅都只喜欢 $5$ 的倍数,因此保证他们喜欢的三角形的所有内角度数都能被 $5$ 整除。

Audrey 想要从她最喜欢的三角形的一个顶点出发,向其对边画一条线段。如果她沿着这条线段剪开三角形,就能将原三角形分割成两个较小的三角形,且这两个较小的三角形都是阮梅喜欢的。这是否可能?

输入格式

第一行包含一个整数 $T$($1 \le T \le 10^4$),表示测试用例的数量。接下来是 $T$ 组测试用例。

每个测试用例的描述占三行:

  • 第一行包含三个整数 $a_1$、$b_1$ 和 $c_1$($5 \le a_1 \le b_1 \le c_1 \le 170$,$a_1 + b_1 + c_1 = 180$)。
  • 第二行包含三个整数 $a_2$、$b_2$ 和 $c_2$($5 \le a_2 \le b_2 \le c_2 \le 170$,$a_2 + b_2 + c_2 = 180$)。
  • 第三行包含三个整数 $a_3$、$b_3$ 和 $c_3$($5 \le a_3 \le b_3 \le c_3 \le 170$,$a_3 + b_3 + c_3 = 180$)。

保证 $a_2 \neq a_3$、$b_2 \neq b_3$ 或 $c_2 \neq c_3$ 中至少有一个成立。此外,保证所有这些值都能被 $5$ 整除。

输出格式

输出 $T$ 行。在第 $i$ 行中,输出第 $i$ 个测试用例的答案。

如果 Audrey 可以通过将她最喜欢的三角形恰好剪一次来形成两个阮梅都喜欢的三角形,则输出 YES。否则,输出 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

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.