Mock CCC '22 1 S1 - Big Mattress Tournament

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 0.25s
Memory limit: 1G

Problem type

Kaity is an administrator for the Big Mattress Tournament, where folks compete to see who can make the biggest mattress.

To ensure every person has an even playing field when assembling mattresses, they will be given the same materials to assemble their mattresses.

Specifically, each participant will be given a 1 \times 1 tiles, b 1 \times 2 tiles, and c L tiles, which are 2 \times 2 tiles with the top-right square removed.

Determine if there is some positive integer m such that it is possible to assemble a 2 \times m mattress with the given tiles. You must use all of the tiles, you may not rotate or reflect any of the tiles, and the mattress must be exactly 2 \times m.

Constraints

1 \le T \le 10^4

0 \le a, b, c \le 10^8

a + b + c > 0

In tests worth 14 marks, a + b + c \le 15.

Input Specification

The first line contains a single integer T.

T lines follow, each containing three integers, a, b, and c.

Output Specification

Output T lines. On the ith line, output YES if it is possible to make a mattress. Output NO otherwise.

Sample Input

4
2 0 0
0 2 0
1 0 1
0 1 0

Sample Output

YES
YES
YES
NO

Comments

There are no comments at the moment.