#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,x,n) for(int i=x;i<=n;i++)
#define all(c) c.begin(),c.end()
#define cin(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define int int64_t
#define pi pair<int,int>
#define countbits __builtin_popcount
const int Nmax=2e5+10;
const int mod=1000000007;
vector<int>prime;


int mod_add(int a, int b, int m) {a = a % m; b = b % m; return (((a + b) % m) + m) % m;}
int mod_mul(int a, int b, int m) {a = a % m; b = b % m; return (((a * b) % m) + m) % m;}
int mod_sub(int a, int b, int m) {a = a % m; b = b % m; return (((a - b) % m) + m) % m;}


int is_power_of_two(int a){
    return a && (!(a&(a-1)));
}


int isperfectsquare(int a){
    double b=sqrt(a);
    return (b-ceil(b)==0);
}

/* POWER FUNCTION*/


int pow(int a,int b,int m){
    a=a%m;
    int res=1;
    while(b>0){
        if(b&1){
            res=res * a%m;
        }
        a=a * a %m;
        b=b/2;
    }
return res;
}
/* SIEVE OF ERATOSTHENES FOR PRIME */
void seive(int n){
    bool isprime[n];
    memset(isprime,true,sizeof(isprime));
    prime.push_back(2);
    for(int i=3;i<=sqrt(n);i+=2){
        if(isprime[i]){
            for(int j=i*i;j<=n;j+=i){
                isprime[j]=false;
            }
        }
    }
    for(int i=3;i<=n;i+=2){
        if(isprime[i]){
            prime.push_back(i);
        }
    }
}


/*YOU CAN SOLVE IT*/

void solve(){
    int n,k;
    cin>>n;
    int a[n];
    cin(a,n);
    f(i,0,n-1){
        if(!isperfectsquare(a[i])){
            cout<<"YES\n";
            return;
        }
    }
    cout<<"NO\n";
}


int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}