Given two jug capacities a and b, decide whether some sequence of fills, empties, and pours can leave exactly c liters in one jug.
You have two jugs with capacities of aaa and bbb liters. Water is unlimited, and you may repeat the following three operations as many times as you like.
Write a program that decides whether you can reach a state where one of the two jugs holds exactly ccc liters.
The first line contains the number of test cases TTT. (1≤T≤100001 \le T \le 100001≤T≤10000)
Each of the next TTT lines contains one test case, given as three integers aaa, bbb, ccc. (1≤a,b,c≤1091 \le a, b, c \le 10^91≤a,b,c≤109)
For each test case, print YES on its own line if exactly ccc liters can be measured, and NO otherwise.
YES
NO
For a=5a = 5a=5, b=3b = 3b=3, c=4c = 4c=4, the following steps produce 4 liters.