#include <bits/stdc++.h>
using namespace std;
#define fo(i, n) for(int i=0; i<n; i++)
#define fo2(i, j, n) for(int i=j; i<n; i++)
#define ll long long
#define si(x)	scanf("%d", &x)
#define sl(x)	scanf("%lld", &x)
#define ss(s)	scanf("%s", &s)
#define pi(x)	printf("%d\n", x)
#define pl(x)	printf("%lld\n", x)
#define ps(s)	printf("%s\n", s)
#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x, y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define pb push_back
#define PI 3.1415926535897932384626
typedef vector<int> vi;

const int mod = 1000000007;
const int N = 3e5, M = N;

int a[N];

bool checkSqr(int i) {
	int temp = sqrt(i);

	return temp * temp == i;
}

/*===============================================================================*/

void solve() {

	int n;
	cin >> n;
	int arr[n];
	fo(i, n) cin >> arr[i];
	bool check = true;
	fo(i, n) {
		check &= checkSqr(arr[i]);
	}
	if (check) cout << "NO\n";
	else cout << "YES\n";

}

/*===============================================================================*/


int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

#ifndef ONLINE_JUDGE
	freopen("i.txt", "r", stdin);
	freopen("o.txt", "w", stdout);
#endif


	int t = 1;
	cin >> t;
	while (t--) {
		solve();
	}


	return 0;
}

int mpow(int base, int exp) {
	base %= mod;
	int result = 1;
	while (exp > 0) {
		if (exp & 1) result = ((ll)result * base) % mod;
		base = ((ll)base * base) % mod;
		exp >>= 1;
	}
	return result;
}

