#include <bits/stdc++.h>
using namespace std;

bool isPerfectSquare(long double x)
{
    if (x >= 0) 
    { 
        long long sr = sqrt(x);
        return (sr * sr == x);
    }
    return false;
}

int main() 
{
    int t;
    cin >> t;
    while(t--)
    {
        int n, flag=0;
        cin >> n;
        int arr[n];
        for(int i=0; i<n; i++) cin >> arr[i];

        for(int i=0; i<n; i++)
        {
            if(isPerfectSquare(arr[i])==false)
            {
                cout << "YES" << "\n";
                flag =1;
                break;
            }
        }
        if(flag==0)
        cout << "NO" << "\n";
            
    }
    return 0;
}
