Johnny just learned about quadratic equations. As an eager young programmer, he immediately wrote the following program to help with his homework:
#include<cstdio>
int main() {
unsigned int a,b,c,x=0;
scanf("%u %u %u",&a,&b,&c);
do {
if (a*x*x+b*x+c==0) {
puts("YES");
return 0;
}
x++;
} while(x);
puts("NO");
return 0;
}
Every calculation is done on unsigned 32-bit integers (that is, modulo 232). The program tries every unsigned 32-bit value of x in turn and prints YES as soon as it finds one with a⋅x2+b⋅x+c≡0(mod232); if no such x exists it prints NO. Unfortunately this brute-force loop is far too slow, even on his brand-new gaming rig. Can you reproduce its output quickly?
The first line contains an integer t (t≤104), the number of test cases. Each of the next t lines contains three space-separated integers a, b, and c (0≤a,b,c<232).
For each test case, print YES if there exists an unsigned 32-bit integer x with a⋅x2+b⋅x+c≡0(mod232), and NO otherwise. Print each answer on its own line, in the order the test cases are given.