CF1463A.Dungeon

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Dungeon

You are playing a new computer game in which you have to fight monsters. In a dungeon you are trying to clear, you met three monsters; the first of them has aa health points, the second has bb health points, and the third has cc.

To kill the monsters, you can use a cannon that, when fired, deals 11 damage to the selected monster. Every 77-th (i. e. shots with numbers 77, 1414, 2121 etc.) cannon shot is enhanced and deals 11 damage to all monsters, not just one of them. If some monster's current amount of health points is 00, it can't be targeted by a regular shot and does not receive damage from an enhanced shot.

You want to pass the dungeon beautifully, i. e., kill all the monsters with the same enhanced shot (i. e. after some enhanced shot, the health points of each of the monsters should become equal to 00 for the first time). Each shot must hit a monster, i. e. each shot deals damage to at least one monster.

Input

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

Each test case consists of a single line that contains three integers aa, bb and cc (1a,b,c1081 \le a, b, c \le 10^8) — the number of health points each monster has.

Output

For each test case, print YES if you can kill all the monsters with the same enhanced shot. Otherwise, print NO. You may print each letter in any case (for example, YES, Yes, yes, yEs will all be recognized as positive answer).

Note

In the first test case, you can do as follows: 11-th shot to the first monster, 22-th shot to the second monster, 33-th shot to the third monster, 44-th shot to the first monster, 55-th shot to the third monster, 66-th shot to the third monster, and 77-th enhanced shot will kill all the monsters.

In the second test case, you can't kill monsters with the same enhanced shot, because the total number of health points of monsters is 33, and you will kill them in the first 3 shots.

Samples

3
3 2 4
1 1 1
10 1 7
YES
NO
NO

在线编程 IDE

建议全屏模式获得最佳体验