CF1463A.Dungeon

普及-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

你正在玩一款新的电脑游戏,游戏中你需要击败怪物。在你试图通关的地牢中,你遇到了三只怪物:第一只怪物有 aa 点生命值,第二只有 bb 点,第三只有 cc 点。

为了击败怪物,你可以使用一门大炮;每次发射会向选定的怪物造成 11 点伤害。每第 77 发(即编号为 77、1414、2121 等的炮弹)是强化炮弹,会对所有怪物各造成 11 点伤害,而不仅限于某一只。若某只怪物当前生命值为 00,则它既不能被普通炮弹选为目标,也不会从强化炮弹中受到伤害。

你希望以“华丽”的方式通关地牢,即:所有怪物恰好在同一发强化炮弹后同时死亡(即在某次强化炮弹命中后,三只怪物的生命值首次同时变为 00)。此外,每次发射都必须击中至少一只怪物(即每次发射造成的总伤害至少为 11)。

输入格式

The first line contains a single integer tt (1≤t≤1041 \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 (1≤a,b,c≤1081 \le a, b, c \le 10^8) — the number of health points each monster has.

第一行包含一个整数 tt(1≤t≤1041 \le t \le 10^4)—— 测试用例的数量。

每个测试用例由一行组成,该行包含三个整数 aa、bb 和 cc(1≤a,b,c≤1081 \le a, b, c \le 10^8)—— 分别表示每个怪物的生命值。

输出格式

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).

对于每个测试用例,如果你能用同一发增强射击消灭所有怪物,则输出 YES;否则输出 NO。你可以以任意大小写形式输出每个字母(例如,YES、Yes、yes、yEs 均会被识别为肯定回答)。

输入输出样例

  • 输入#1

    3
    3 2 4
    1 1 1
    10 1 7

    输出#1

    YES
    NO
    NO

说明/提示

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.

在第一个测试用例中,你可以按如下方式操作:第 11 次射击攻击第一只怪物,第 22 次射击攻击第二只怪物,第 33 次射击攻击第三只怪物,第 44 次射击攻击第一只怪物,第 55 次射击攻击第三只怪物,第 66 次射击攻击第三只怪物,而第 77 次增强射击将消灭所有怪物。

在第二个测试用例中,你无法用同一次增强射击消灭所有怪物,因为怪物的总生命值为 33,你将在前 33 次射击中就将其全部消灭。

输入解题思路,AI测评打分。不知道怎么写?

首页