#include #include #include #include using namespace std; int Case; typedef long long ll; int main() { scanf("%d",&Case); while(Case -- ){ ll a,b,c; scanf("%I64d%I64d%I64d",&a,&b,&c); ll tmp = b * b - 4 * a * c; if(tmp < 0) { printf("NO\n"); continue; } ll sq = sqrt((double)tmp); ll x1 = (2 * a) * (- b + sq); ll x2 = (2 * a) * (- b - sq); if(sq * sq == tmp && (x1 > 0 && x2 > 0|| x1 < 0 && x2 < 0 )) { puts("YES"); } else { puts("NO"); } } }