#include #include #include #include #define LL __int64 using namespace std; int main() { int T; scanf("%d",&T); while(T--) { bool wc=false; LL a,b,c; scanf("%I64d%I64d%I64d",&a,&b,&c); if((b*b-4*a*c)<0) { printf("NO\n"); } else { LL i,j; for(i=1;i<=sqrt(a);i++) { for(j=1;j<=sqrt(c);j++) { if(a%i==0&&c%j==0) { LL xx,yy,uu,ii; xx=i,yy=a/i,uu=j,ii=c/j; if((xx*ii+yy*uu)==b||(xx*uu+yy*ii)==b) { wc=true; break; } } } if(wc==true) break; } if(wc==true) printf("YES\n"); else printf("NO\n"); } } return 0; }