CF2104A.Three Decks

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

Three Decks

Monocarp placed three decks of cards in a row on the table. The first deck consists of aa cards, the second deck consists of bb cards, and the third deck consists of cc cards, with the condition a<b<ca \lt b \lt c.

Monocarp wants to take some number of cards (at least one, but no more than cc) from the third deck and distribute them between the first two decks so that each of the taken cards ends up in either the first or the second deck. It is possible that all the cards taken from the third deck will go into the same deck.

Your task is to determine whether Monocarp can make the number of cards in all three decks equal using the described operation.

Input

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

The only line of each test case contains three integers a,ba, b, and cc (1a,b,c1081 \le a, b, c \le 10^8) — the number of cards in the first, second, and third decks, respectively.

Additional constraint on the input: a<b<ca \lt b \lt c.

Output

For each test case, output "YES" (without quotes) if Monocarp can make the number of cards in all three decks equal using the described operation. Otherwise, output "NO" (without quotes).

Note

In the first test case, Monocarp has to take 44 cards from the third deck, put 33 cards in the first deck, and 11 card in the second deck. Thus, there will be 66 cards in all three decks.

In the second test case, it is impossible to make the number of cards in all three decks equal.

In the third test case, Monocarp has to take 22 cards from the third deck and put both in the first deck. Thus, there will be 55 cards in all three decks.

In the fourth test case, it is also impossible to make the number of cards in all three decks equal.

Samples

4
3 5 10
12 20 30
3 5 7
1 5 6
YES
NO
YES
NO

在线编程 IDE

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