Block
Time limit1sMemory limit1024 MB
Given A unit squares, B dominoes, and C L-shaped trominoes, decide whether they tile a height-2 rectangle with no gaps and all tiles used.
- Level
Medium4 of 10
- Topics
- Math, Greedy, Implementation, Brute force
- Solved
- No attempts yet
Problem
You are given tiles of the first kind, tiles of the second kind, and tiles of the third kind, as shown in the figure below. Write a program that prints Yes if you can build a rectangle of height 2, and No otherwise.
The finished rectangle must have no empty space, and you must use every tile you are given. Tiles cannot be rotated.

For example, with one tile, three tiles, and one L-shaped tile, you can build a rectangle of height 2 as in the figure below.

But with one tile, two tiles, and no L-shaped tile, you can never build a rectangle of height 2, as in the figure below.

Input
The first line contains an integer , the number of test cases.
Each of the next lines contains three integers , , . , , and are the numbers of tiles, tiles, and L-shaped tiles, respectively.
Output
For each test case, print the answer on its own line, for lines in total.