#include #include using namespace std; int main() { int T; scanf("%d", &T); while(T--) { long long a,b,c; scanf("%I64d %I64d %I64d", &a, &b, &c); long long d = b * b - 4 * a * c; if(d < 0) { printf("NO\n"); continue; } long long sqr = sqrt(d); if(sqr * sqr != d) { printf("NO\n"); continue; } long long fz1 = -b + sqr; long long fz2 = -b - sqr; long long fm = 2 * a; //printf("%I64d %I64d\n", fz1, fz2); if(a * fz1 % fm != 0 || a * fz2 % fm != 0) { printf("NO\n"); continue; } printf("YES\n"); } return 0; }