#include <stdio.h>
#include <stdlib.h>
#include<math.h>
#define S 1001
int IsSquare(int n){
int i,flag=0;
for(int i=0;i<=n;i++){
if(i*i == n){
flag = 1;
}
}
return flag;
}
int main(){
int n;
int a[S];
int b[S];
int c[S];
int D[S];
int flag;
scanf("%d", &n);
for(int i=0;i<n;i++){
scanf("%d %d %d",&a[i],&b[i],&c[i]);
D[i] = b[i]*b[i] - 4*(a[i]*c[i]); //b^2-4ac
//printf("%d", D[i]);
}
for(int j=0;j<n;j++){
if(D[j] >= 0){
flag = sqrt(D[j]);
flag = IsSquare(flag);
if(a != 0) flag = 1;
} else flag = 0;
if(flag == 1) printf("Yes\n");
else printf("No\n");
}
return 0;
}
flag = sqrt(D[j]);
flag = IsSquare(flag);
if(a != 0) flag = 1;
改成
flag = IsSquare(D[j]);