Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<stdio.

h>
#include<math.h>
#include<stdlib.h>
long m[1000000];
int check(int n)
{float p=sqrt(n);
if(p*p==n*n)
return 1;
else
return 0;
}
int main()
{
long i,l;
scanf("%ld",&l);
for(i=0;i<l;i++)
scanf("%ld",&m[i]);
for(i=0;i<l;i++)
{
if(abs(check(m[i]*m[i]*5-4))==1 || check(m[i]*m[i]*5+4)==1)
printf("YES");
else
printf("NO");
}
return 0;
}

a=m[i]*m[i]*5-4;
b=m[i]*m[i]*5+4;
a,b

You might also like