Under construction

Still being built. Things may change

Origami

Time limit2sMemory limit256 MB

Summary
Given an a by b grid, decide whether repeated full-length cuts that discard one piece can leave a rectangle of exactly S cells.
Level

Easy3 of 10

Topics
Math, Implementation, Number theory, Brute force
Solved
No attempts yet

Problem

Pasha has loved origami since childhood.

Recently he found a description of a very interesting paper figure online. Its special property is that to make it, you may start with any grid sheet containing exactly SS cells.

Pasha decided to make it right away, but unfortunately he only has a sheet of size aa by bb cells. So Pasha picked up a pair of scissors.

Pasha can cut his current sheet along cell boundaries with one cut that goes all the way across the sheet, splitting it into two rectangular pieces, then throw away one piece and keep working with the other. In this way Pasha can make several cuts.

Help Pasha determine whether he can make cuts so that the resulting sheet is a rectangle containing exactly SS cells.

Input

The first line contains an integer TT, the number of test cases in the input. TT does not exceed 200. The descriptions of the test cases follow.

Each test case is described by a single line. This line contains three positive integers aa, bb, SS: the length and width of Pasha's sheet and the area of the sheet he wants to obtain. Each number does not exceed 10910^9.

Output

For each of the TT test cases, print YES on a separate line if Pasha can cut the sheet to obtain a rectangle of area exactly SS, otherwise print NO.

Examples1

  1. Example 1

    Input
    4
    2 5 9
    7 8 40
    3 4 21
    1 1 1
    
    Expected output
    NO
    YES
    NO
    YES