Given an array $a$ of length $n$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.

A sequence $b$ is a subsequence of an array $a$ if $b$ can be obtained from $a$ by deleting some (possibly zero) elements.


-----Input-----

The first line contains an integer $t$ ($1 \le t \le 100$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains an integer $n$ ($1 \le n \le 100$) — the length of the array $a$.

The second line of each test case contains $n$ integers $a_1$, $a_2$, $\ldots$, $a_{n}$ ($1 \le a_i \le 10^4$) — the elements of the array $a$.


-----Output-----

If there's a subsequence of $a$ whose product isn't a perfect square, print "YES". Otherwise, print "NO".


-----Examples-----

Input
2
3
1 5 4
2
100 10000
Output
YES
NO


-----Note-----

In the first example, the product of the whole array ($20$) isn't a perfect square.

In the second example, all subsequences have a perfect square product.

Difficulty: EASY
Tags: Number theory

Mathematics

Starter code:

Solutions:
from math import *
for i in range(int(input())):
	n = int(input())
	cnt = False
	l = list(map(int, input().split()))
	for el in l:
		af = el ** 0.5
		if af - trunc(af) != 0:
			print('YES')
			cnt = True
			break
	if cnt:
		continue
	print('NO')


a = int(input())
b = []
c = []
y = -1
for r in range(a):
	b += [int(input())]
	c += [input().split()]
for s in c:
	x = 0
	y += 1
	for t in s:
		x += 1
		if int(t) ** (1 / 2) != int(int(t) ** (1 / 2)):
			print('YES')
			break
		elif x == int(b[y]) and int(t) ** (1 / 2) == int(int(t) ** (1 / 2)):
			print('NO')
			break
		else:
			continue


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = 'NO'
	for e in arr:
		x = e ** 0.5
		if x != int(x):
			ans = 'YES'
			break
	print(ans)


from math import gcd, ceil, floor
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	flag = 0
	for i in a:
		if ceil(i ** (1 / 2)) != floor(i ** (1 / 2)):
			flag = 1
			break
	if flag:
		print('YES')
	else:
		print('NO')


import sys
input = lambda : sys.stdin.readline().strip()

def all_p_square(arr):
	ans = True
	for i in arr:
		if int(i ** 0.5) != i ** 0.5:
			ans = False
			break
	return ans
for i in range(int(input())):
	l = int(input())
	arr = list(map(int, input().split()))
	print('YES' if all_p_square(arr) == False else 'NO')


for __ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ans = 'NO'
	for elem in ar:
		i = 2
		while i * i <= elem:
			while elem % i == 0 and elem % (i * i) == 0:
				elem //= i
				elem //= i
			i += 1
		if elem != 1:
			ans = 'YES'
			break
	print(ans)


import math
for tc in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	bb = 'NO'
	for i in li:
		if math.sqrt(i) != math.isqrt(i):
			bb = 'YES'
	print(bb)


import math
x = int(input())
for i in range(x):
	e = int(input())
	z = list(map(int, input().split()))
	k = 1
	count = 0
	for j in z:
		if int(math.pow(j, 1 / 2)) != float(math.pow(j, 1 / 2)):
			count += 1
			break
	if count == 0:
		print('NO')
	else:
		print('YES')


import math
t = int(input())
for i in range(t):
	n = int(input())
	nums = list(map(int, input().split()))
	for j in nums:
		if int(math.sqrt(j) + 0.5) ** 2 != j:
			print('YES')
			break
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	d = False
	for i in range(len(a)):
		y = math.sqrt(a[i])
		if int(y + 0.5) ** 2 == a[i]:
			d = True
		else:
			d = False
			break
	if d == True:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = False
	for i in range(n):
		m = int(pow(a[i], 0.5))
		if pow(m, 2) != a[i]:
			b = True
	if b:
		print('YES')
	else:
		print('NO')


from math import *
while True:
	try:
		t = eval(input())
		for i in range(t):
			n = eval(input())
			a = list(map(int, input().split()))
			f = True
			for j in range(n):
				sum1 = int(sqrt(a[j]))
				if sum1 * sum1 != a[j]:
					f = False
					print('YES')
					break
			if f:
				print('NO')
	except:
		break


t = int(input())
for r in range(t):
	n = int(input())
	k = list(map(int, input().split()))
	fl = 0
	for x in k:
		if int(x ** 0.5) != x ** 0.5:
			fl = 1
	if fl == 1:
		print('YES')
	else:
		print('NO')


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	a = [sqrt(x).is_integer() for x in map(int, input().split())]
	print('NO' if all(a) else 'YES')


for x in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	f = 1
	for i in range(n):
		val = pow(l[i], 0.5)
		if val != int(val):
			f = 0
			break
	if f == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	flag = 0
	for i in range(n):
		x = l[i] ** 0.5
		if x != int(x):
			flag = 1
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')


from sys import stdin
input = stdin.readline
from collections import Counter
from itertools import accumulate
import operator
import math

def solve():
	n = int(input())
	A = [int(char) for char in input().split()]
	for a in A:
		if a != math.isqrt(a) ** 2:
			return False
	return True
for _ in range(int(input())):
	if not solve():
		print('YES')
	else:
		print('NO')


import math
from collections import defaultdict
from sys import stdout
NO = 'NO'
YES = 'YES'
MOD = 1000000007
ALPH = 'abcdefghijklmnopqrstuvwxyz'

def input_int():
	return int(input())

def input_list():
	return input().split(' ')

def input_list_int():
	return list(map(int, input_list()))

def list_int_to_str(a, sep=' '):
	return sep.join((str(x) for x in a))

def z_func(s):
	n = len(s)
	z = [0] * n
	l = r = 0
	for i in range(1, n):
		if r >= i:
			z[i] = min(z[i - l], r - i + 1)
		while z[i] + i < n and s[z[i]] == s[z[i] + i]:
			z[i] += 1
		if i + z[i] - 1 > r:
			l = i
			r = i + z[i] - 15
	return z

def bs_down(a, x):
	l = -1
	r = len(a)
	while l + 1 < r:
		m = (l + r) // 2
		if a[m] <= x:
			l = m
		else:
			r = m
	return l

def bs_upper(a, x):
	l = -1
	r = len(a)
	while l + 1 < r:
		m = (l + r) // 2
		if a[m] < x:
			l = m
		else:
			r = m
	return r
global_ans = []

def pr(a):
	global_ans.append(a)

def solve():
	n = input_int()
	a = input_list_int()
	for i in a:
		m = math.ceil(math.sqrt(i))
		if m * m != i:
			pr(YES)
			return
	pr(NO)
query_count = 1
query_count = input_int()
while query_count:
	query_count -= 1
	solve()
for global_ans_line in global_ans:
	print(global_ans_line)


for __ in range(int(input())):
	int(input())
	c = 1
	l = list(map(int, input().split()))
	for j in l:
		if j ** 0.5 - int(j ** 0.5) != 0:
			print('YES')
			c = 0
			break
	if c == 1:
		print('NO')


def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())
from math import *
for _ in range(ii()):
	n = ii()
	l = li()
	f = 1
	for i in l:
		if sqrt(i) != int(sqrt(i)):
			print('YES')
			f = 0
			break
	if f:
		print('NO')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	f = False
	for i in arr:
		if i ** 0.5 != int(i ** 0.5):
			f = True
			break
	if f:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	flag = False
	for i in range(n):
		if a[i] == 1:
			continue
		if int(math.sqrt(a[i])) != math.sqrt(a[i]):
			flag = True
			break
	if flag:
		print('YES')
	else:
		print('NO')


import math
for __ in range(int(input())):
	N = int(input())
	arr = list(map(int, input().split()))
	flag = 0
	for i in arr:
		x = int(math.sqrt(i))
		if x * x != i:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	n = int(input())
	l = list(map(int, input().split()))
	n = 0
	for i in l:
		if i ** 0.5 != int(i ** 0.5):
			n = 1
			break
	if n == 0:
		print('NO')
	else:
		print('YES')


import math
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	flag = 0
	for i in range(n):
		sq = math.sqrt(a[i])
		if sq != int(a[i] ** 0.5):
			flag = 1
			break
	if flag:
		print('YES')
	else:
		print('NO')


import math

def is_square(x):
	sqrt_x = int(math.sqrt(x))
	if sqrt_x * sqrt_x == x:
		return True
	return False
T = int(input())
for t in range(T):
	N = int(input())
	aa = [int(x) for x in input().split()]
	all_square = True
	for x in aa:
		if not is_square(x):
			all_square = False
			break
	if all_square:
		print('NO')
	else:
		print('YES')


import math
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	key = 0
	for i in range(n):
		if math.ceil(math.sqrt(a[i])) != math.floor(math.sqrt(a[i])):
			print('YES')
			key = 1
			break
	if key == 0:
		print('NO')


import sys, math, cmath, time
start_time = time.time()

def solve():
	n = inp()
	a = inlt()
	qw = 'YES' if sum([1 if int(a[i] ** 0.5) ** 2 != a[i] else 0 for i in range(len(a))]) >= 1 else 'NO'
	print(qw)

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % m
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

def power_two(x):
	return x and (not x & x - 1)

def ceil(a, b):
	return -(-a // b)

def seive(n):
	a = [1]
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			a.append(p)
	return a

def ncr(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(s) for s in input().split()]
	for e in a:
		sqr = e ** 0.5
		if sqr != int(sqr):
			print('YES')
			break
	else:
		print('NO')


for _ in ' ' * int(input()):
	(n, x, c) = (int(input()), list(map(int, input().split())), 'NO')
	for i in range(n):
		if x[i] ** (1 / 2) != int(x[i] ** (1 / 2)) + 0.0:
			c = 'YES'
			break
		else:
			continue
	print(c)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	c = 0
	for i in l:
		r = math.sqrt(i)
		if int(r + 0.5) ** 2 == i:
			c += 1
	if c == n:
		print('NO')
	else:
		print('YES')


import math

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	for i in a:
		ans = int(math.sqrt(i))
		if ans * ans != i:
			return 'YES'
	return 'NO'
for i in range(int(input())):
	print(solve())


import math
for _ in range(int(input())):
	__ = input()
	arr = [int(x) for x in input().split()]
	perfect = True
	for x in arr:
		y = math.sqrt(x)
		if y != y // 1:
			perfect = False
			break
	if perfect:
		print('NO')
	else:
		print('YES')


import math
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	cnt = 0
	for j in range(n):
		res = math.sqrt(a[j])
		if res - int(res) != 0:
			cnt = 1
			break
	if cnt:
		print('YES')
	else:
		print('NO')


a = [i * i for i in range(101)]
for s in [*open(0)][2::2]:
	l = [*map(int, s.split())]
	for i in l:
		if i not in a:
			print('YES')
			break
	else:
		print('NO')


t = int(input())
from math import sqrt

def solve():
	n = int(input())
	arr = [int(i) for i in input().split()]
	x = []
	for i in arr:
		if sqrt(i) == int(sqrt(i)):
			x.append(i)
		else:
			print('YES')
			return
	for i in range(len(x)):
		for j in range(len(x)):
			if i != j:
				if sqrt(x[i] * x[j]) != int(sqrt(x[i] * x[j])):
					print('YES')
					return
	print('NO')
while t:
	solve()
	t -= 1


import math as m
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	f = 0
	for i in range(n):
		if int(m.sqrt(l[i])) != m.sqrt(l[i]):
			f = 1
	if f == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	for x in map(int, input().split()):
		if int(x ** 0.5) ** 2 != x:
			print('YES')
			break
	else:
		print('NO')


for _ in range(int(input())):
	x = int(input())
	l = list(map(int, input().split()))
	p = 'NO'
	for i in l:
		if i ** 0.5 != int(i ** 0.5):
			p = 'YES'
			break
	print(p)


import math

def solve():
	length = int(input())
	array = list(map(int, input().split()))
	ans = True
	for i in array:
		j = float(math.sqrt(i))
		s = int(j)
		j = j - s
		if j != 0:
			print('Yes')
			return
	print('No')
T = int(input())
while T != 0:
	T = T - 1
	solve()


import math
for k in range(int(input())):
	n = int(input())
	ls = list(map(int, input().split()))
	flag = 0
	for i in ls:
		if not math.sqrt(i).is_integer():
			flag = 1
			break
	if flag:
		print('YES')
	else:
		print('NO')


import math

def is_square(integer):
	root = math.sqrt(integer)
	return integer == int(root) ** 2
for T in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	for i in arr:
		if not is_square(i):
			print('YES')
			break
	else:
		print('NO')


import sys, os.path, math
from collections import defaultdict, deque
if os.path.exists('amz42.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for _ in range(int(input().strip(' '))):
	n = int(input().strip(' '))
	l = [int(x) for x in input().strip(' ').split(' ')]
	for i in l:
		sq = int(i ** 0.5)
		if sq * sq != i:
			print('YES')
			break
	else:
		print('NO')


import math
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	result = True
	for i in arr:
		root = math.sqrt(i)
		diff = root - int(root)
		if diff != 0:
			result = False
			break
	if result:
		print('NO')
	else:
		print('YES')


import math
for _ in range(int(input())):
	n = int(input())
	ai = list(map(int, input().split()))
	for i in ai:
		if math.sqrt(i).is_integer():
			continue
		else:
			print('YES')
			break
	else:
		print('NO')


from math import *
for y in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	foo = 0
	for i in lst:
		if sqrt(i) != int(sqrt(i)):
			foo = 1
			break
	if foo:
		print('YES')
	else:
		print('NO')


from functools import reduce

def is_prefect_square(x):
	return x ** 0.5 == int(x ** 0.5)
for _ in range(int(input())):
	input()
	l = list(map(int, input().split()))
	if all(list(map(is_prefect_square, l))):
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	b = True
	a = int(input())
	l = list(map(int, input().split()))
	for j in range(len(l)):
		if l[j] ** (1 / 2) != int(l[j] ** (1 / 2)):
			b = False
			break
	if b == True:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	f = 0
	for i in a:
		if i ** 0.5 != int(i ** 0.5):
			f = 1
			break
	if f:
		print('YES')
	else:
		print('NO')


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		arr = [int(i) for i in input().split()]
		token = 0
		for d in arr:
			if int(d ** (1 / 2)) * int(d ** (1 / 2)) != d:
				token = 1
				print('YES')
				break
		if token == 0:
			print('NO')
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	res = False
	for i in a:
		if math.sqrt(i) != int(math.sqrt(i)):
			res = True
			break
	if res:
		print('YES')
	else:
		print('NO')


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = False
	for x in a:
		ans |= int(sqrt(x)) * int(sqrt(x)) != x
	print('YES' if ans else 'NO')


import sys

def I():
	return int(sys.stdin.readline().rstrip())

def MI():
	return map(int, sys.stdin.readline().rstrip().split())

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def LI2():
	return list(map(int, sys.stdin.readline().rstrip()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	return list(sys.stdin.readline().rstrip().split())

def LS2():
	return list(sys.stdin.readline().rstrip())
t = I()
square = [i ** 2 for i in range(1, 101)]
square = set(square)
for _ in range(t):
	n = I()
	A = LI()
	for a in A:
		if not a in square:
			print('YES')
			break
	else:
		print('NO')


def solution():
	n = int(input())
	arr = list(map(int, input().split()))
	for num in arr:
		root = num ** 0.5
		if root != int(root):
			print('YES')
			return
	print('NO')
	return
t = int(input())
while t:
	t -= 1
	solution()


import math

def is_square(a):
	if int(math.sqrt(a)) ** 2 == a:
		return False
	else:
		return True
n = int(input())
for i in range(n):
	k = input()
	m = [int(i) for i in input().split()]
	for j in m:
		if is_square(j):
			print('YES')
			break
	else:
		print('NO')


def func(n, l):
	for j in range(len(l)):
		if l[j] ** (1 / 2) != int(l[j] ** (1 / 2)):
			return 'YES'
	return 'NO'
for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(func(n, l))


import math
t = int(input())
while t:
	n = int(input())
	nums = list(map(int, input().split()))
	for i in nums:
		if pow(int(math.sqrt(i)), 2) != i:
			print('YES')
			break
	else:
		print('NO')
	t -= 1


import math
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	flag = False
	for num in l:
		cur = math.sqrt(num)
		if cur - math.floor(cur) != 0:
			flag = True
			break
	if flag:
		print('YES')
	else:
		print('NO')


import math

def solve(arr):
	for i in arr:
		a = i ** 0.5
		if math.ceil(a) != math.floor(a):
			print('YES')
			return
	print('NO')
for _ in range(int(input())):
	n = int(input())
	a1 = list(map(int, input().split()))
	solve(a1)


import math
t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	flag = 0
	for j in range(len(arr)):
		val = arr[j]
		root = int(math.sqrt(val))
		if root ** 2 != val:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
from math import sqrt

def check(num):
	a = sqrt(num)
	if int(a) == a:
		return False
	else:
		return True
for x in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	er = 0
	for y in lst:
		if check(y):
			print('YES')
			er = 1
			break
	if er == 0:
		print('NO')


from math import sqrt

def f(a):
	for i in a:
		if sqrt(i) != int(sqrt(i)):
			return 'YES'
	return 'NO'
for i in range(int(input())):
	a = input()
	lst = list(map(int, input().strip().split()))
	print(f(lst))


from math import sqrt, floor
t = int(input())
for _ in range(t):
	(n, a) = (int(input()), [int(i) for i in input().split()])
	res = 'YES' if any((i != floor(sqrt(i)) ** 2 for i in a)) else 'NO'
	print(res)


import sys
input = sys.stdin.buffer.readline
S = set([i * i for i in range(1, 101)])
for t in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	for i in range(N):
		if not A[i] in S:
			print('YES')
			break
	else:
		print('NO')


import math
rr = input
rri = lambda : int(rr())
rrm = lambda : list(map(int, rr().split()))

def perfect_square(n):
	root = math.sqrt(n)
	if int(root + 0.5) ** 2 == n:
		return True
	else:
		return False

def prod(lst):
	ret = 1
	for i in lst:
		ret *= i
	return ret

def solve():
	n = rri()
	lst = rrm()
	for i in lst:
		if not perfect_square(i):
			return 'YES'
	return 'NO'
T = rri()
for t in range(T):
	print(solve())


from math import sqrt

def solve():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = list(map(int, input().split(' ')))
		a = [x == int(sqrt(x) + 0.5) ** 2 for x in a]
		if False in a:
			print('YES')
		else:
			print('NO')
solve()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	exist = False
	for x in a:
		if int(x ** 0.5) ** 2 != x:
			exist = True
			break
	if exist:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	input()
	s = 'NO'
	for i in list(map(int, input().split(' '))):
		if i ** 0.5 % 1:
			s = 'YES'
			break
	print(s)


from math import sqrt, ceil
for i in range(int(input())):
	n = int(input())
	l = list(set(map(int, input().split())))
	c = 0
	for j in l:
		if int(ceil(sqrt(j)) ** 2) != int(j):
			print('YES')
			c = -1
			break
	if c == 0:
		print('NO')


from math import sqrt
t = int(input())
L = []
for i in range(t):
	n = int(input())
	L.append(list(map(int, input().split(' '))))

def check(l):
	for n in l:
		if sqrt(n) % 1 != 0:
			return 'YES'
	return 'NO'
for l in L:
	print(check(l))


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	ans = 'NO'
	for i in range(n):
		if a[i] ** 0.5 != int(a[i] ** 0.5):
			ans = 'YES'
			break
	print(ans)


import sys
import math
from itertools import combinations

def get_line():
	return list(map(int, sys.stdin.readline().strip().split()))

def in1():
	return int(input())
for _ in range(in1()):
	n = in1()
	a = get_line()
	t = 0
	for i in range(n):
		t1 = int(math.sqrt(a[i]))
		if t1 * t1 != a[i]:
			t = 1
			break
	if t == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
import math

def check(mylist, size):
	for i in range(size):
		root = math.sqrt(mylist[i])
		if int(root + 0.5) ** 2 != mylist[i]:
			return True
for i in range(t):
	size = int(input())
	mylist = list(map(int, input().split()))
	if check(mylist, size):
		print('YES')
	else:
		print('NO')


from math import *
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	pro = 1
	ans = True
	for i in range(n):
		if sqrt(a[i]) != int(sqrt(a[i])):
			ans = False
			break
	if ans == True:
		print('NO')
	else:
		print('YES')


import sys
import math
import bisect
import heapq
from bisect import bisect_right
from sys import stdin, stdout

def get_ints_in_variables():
	return map(int, sys.stdin.readline().strip().split())

def get_int():
	return int(sys.stdin.readline())

def get_ints_in_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def Solution():
	pass

def main():
	hm = {}
	for i in range(1, 101):
		hm[i * i] = True
	for _ in range(get_int()):
		n = get_int()
		arr = get_ints_in_list()
		flag = 0
		for v in arr:
			if not v in hm:
				flag = 1
				break
		if flag:
			print('YES')
		else:
			print('NO')
main()


s = set()
s.add(1)
for i in range(2, 101):
	j = i * i
	while j < 10001:
		s.add(j)
		j = j * j
t = int(input())
while t > 0:
	t = t - 1
	k = 0
	n = int(input())
	l = [int(i) for i in input().split()]
	for i in range(n):
		if l[i] not in s:
			k = 1
			break
	if k == 1:
		print('YES')
	else:
		print('NO')


c = {}
for x in range(1, 1000):
	c[x * x] = 1
for _ in range(int(input())):
	n = int(input())
	print('NO' if all((x in c for x in map(int, input().split()))) else 'YES')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = False
	for i in arr:
		if i ** (1 / 2) != int(i ** (1 / 2)):
			print('YES')
			ans = True
			break
	if not ans:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	perfect = 'NO'
	a = list(map(int, input().split()))
	for el in a:
		new = el ** 0.5
		if not new.is_integer():
			perfect = 'YES'
	print(perfect)


import math

def solve(A, n):
	for a in A:
		sqr = int(math.sqrt(a))
		if a != sqr * sqr:
			return True
	return False
t = int(input())
for tc in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	result = solve(A, n)
	print('YES' if result else 'NO')


import math

def check(n):
	if math.sqrt(n) % 1.0 != 0:
		return True
	else:
		return False
for _ in range(int(input())):
	n = int(input())
	lis = list(map(int, input().split()))
	flag = False
	for i in lis:
		if check(i):
			print('YES')
			flag = True
			break
	if not flag:
		print('NO')


for i in range(int(input())):
	n = int(input())
	flg = 0
	for i in map(int, input().split()):
		if i ** 0.5 != int(i ** 0.5):
			flg = 1
			break
	print('YES' if flg else 'NO')


from math import sqrt

def sq_prod(n):
	for i in range(len(a)):
		x = int(sqrt(a[i]))
		if x * x == a[i]:
			continue
		else:
			return 'YES'
	return 'NO'
tt = int(input())
for t in range(tt):
	n = int(input())
	a = [int(i) for i in input().split()]
	print(sq_prod(n))


from math import ceil, sqrt
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	r = 0
	for i in l:
		if ceil(sqrt(i)) ** 2 != i:
			r = 1
			break
	if r:
		print('YES')
	else:
		print('NO')


import os, sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
from math import sqrt
ck = set()
i = 1
while i * i < 10001:
	ck.add(i * i)
	i += 1
for _ in range(int(input())):
	n = int(input())
	ans = 'NO'
	for i in list(map(int, input().split())):
		if i not in ck:
			ans = 'YES'
			break
	print(ans)


def not_square(a):
	return int(a ** (1 / 2)) ** 2 != a

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	cnt = sum((not_square(x) for x in a))
	print('NO' if cnt == 0 else 'YES')
for _ in range(int(input())):
	solve()


from math import sqrt

def check(n, l):
	for i in range(n):
		t = sqrt(l[i])
		if t != int(t):
			return True
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	if check(n, l):
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	nnum = int(input())
	liss = list(map(int, input().split()))
	ck = 0
	for i in liss:
		xx = math.sqrt(i)
		if xx.is_integer():
			continue
		else:
			ck = 1
	if ck == 1:
		print('YES')
	else:
		print('NO')


def main():
	T = int(input())
	while T:
		n = int(input())
		arr = list(map(int, input().split()))
		result = False
		for i in arr:
			temp = int(i ** (1 / 2))
			if temp * temp != i:
				result = True
				break
		if result:
			print('YES')
		else:
			print('NO')
		T -= 1
main()


n = int(input())
for i in range(n):
	result = False
	_ = input()
	arr = [int(x) for x in input().split(' ')]
	for x in arr:
		if x ** 0.5 % 1 != 0:
			result = True
			break
	print('YES' if result else 'NO')


test = int(input())
for t in range(0, test):
	n = int(input())
	l1 = list(map(int, input().split()))
	for i in range(0, len(l1)):
		if l1[i] ** 0.5 % 1 == 0:
			c = 0
		else:
			c = 1
			break
	if c == 1:
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	f = 1
	c = 0
	for i in range(n):
		d = math.sqrt(a[i])
		if math.ceil(d) == math.floor(d):
			c += 1
		else:
			print('YES')
			break
	if c == n:
		print('NO')


from math import sqrt

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		ans = 0
		for i in a:
			sq = int(sqrt(i))
			if sq * sq != i:
				ans = 1
				break
		if ans:
			print('YES')
		else:
			print('NO')
main()


def isSquare(num):
	from math import ceil, floor
	return ceil(num ** 0.5) == floor(num ** 0.5)
for _ in range(int(input())):
	n = int(input())
	arr = [int(w) for w in input().split(' ')]
	ans = 'Yes'
	c = 0
	for item in arr:
		if isSquare(item) == True:
			c = c + 1
	if c == n:
		ans = 'No'
	print(ans)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if not any((i for i in arr if not (i ** 0.5).is_integer())):
		print('NO')
	else:
		print('YES')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from functools import cmp_to_key
from heapq import *
from math import gcd, factorial, floor, ceil, sqrt, log2
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def testcase(t):
	for pp in range(t):
		solve(pp)

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def modInverse(b):
	g = gcd(b, mod)
	if g != 1:
		return -1
	else:
		return pow(b, mod - 2, mod)

def power(x, y, p):
	y %= p - 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
inf = pow(10, 20)
mod = 10 ** 9 + 7

def chck(a):
	return ceil(sqrt(a)) == floor(sqrt(a))

def solve(case):
	n = int(inp())
	a = lis()
	f = True
	for i in range(n):
		if not chck(a[i]):
			f = False
	print('YES' if not f else 'NO')
testcase(int(inp()))


for _ in range(int(input())):
	n = int(input())
	m = list(map(int, input().split()))
	out = False
	for i in range(n):
		if m[i] ** 0.5 * 10 != int(m[i] ** 0.5) * 10:
			out = True
	print('YES' if out else 'NO')


for _ in range(int(input())):
	n = int(input())
	c = 0
	ll = list(map(int, input().split()))
	for x in ll:
		if x ** 0.5 - int(x ** 0.5) != 0:
			c = 1
			break
	if c == 0:
		print('NO')
		continue
	print('YES')


from math import sqrt
t = int(input())
while t:
	n = int(input())
	arr = list(map(int, input().split()))
	ans = 'NO'
	for i in arr:
		if int(sqrt(i)) != sqrt(i):
			ans = 'YES'
			break
	print(ans)
	t -= 1


import math
t = int(input())
for _ in range(t):
	n = int(input())
	result = False
	for n in input().split(' '):
		n = int(n)
		if math.sqrt(n) % 1 > 0:
			result = True
	if result:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for kk in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	k = 0
	for i in range(n):
		if math.sqrt(a[i]) != int(math.sqrt(a[i])):
			k = 1
			break
	if k == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	otv = 'NO'
	for i in range(n):
		if int(a[i] ** 0.5) ** 2 < a[i] and int(a[i] ** 0.5) ** 2 != a[i]:
			otv = 'YES'
	print(otv)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		good = False
		for i in range(n):
			if a[i] ** 0.5 % 1 != 0:
				good = True
				break
		if good:
			print('YES')
		else:
			print('NO')
main()


import sys

def read_ints():
	return [int(i) for i in sys.stdin.readline().strip().split()]

def read_int():
	return int(sys.stdin.readline().strip())
SQS = [a * a for a in range(101)]
t = read_int()
for i in range(t):
	n = read_int()
	aa = read_ints()
	if all((a in SQS for a in aa)):
		print('NO')
	else:
		print('YES')


import math

def is_square(x):
	y = math.sqrt(x)
	return y == math.floor(y)
T = int(input())
for t in range(T):
	n = int(input())
	a = list(map(int, input().split(' ')))
	flag = False
	for (i, ai) in enumerate(a):
		if not is_square(ai):
			flag = True
			break
	print('YES' if flag else 'NO')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	lst = input().split()
	lst = [int(i) for i in lst]
	for i in lst:
		if int(math.sqrt(i)) * int(math.sqrt(i)) != i:
			print('YES')
			break
	else:
		print('NO')


from math import sqrt
test = int(input())
for _ in range(test):
	n = int(input())
	find = False
	arr = list(map(int, input().split()))
	for item in arr:
		if sqrt(item) != int(sqrt(item)):
			print('YES')
			find = True
			break
	if not find:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	ans = 'NO'
	for num in a:
		sqrt = int(num ** 0.5)
		if sqrt ** 2 < num:
			ans = 'YES'
	print(ans)


import math
t = int(input())

def solve():
	n = int(input())
	l = [int(x) for x in input().split()]
	for num in l:
		temp = int(math.sqrt(num))
		if temp * temp != num:
			print('YES')
			return
	print('NO')
while t > 0:
	solve()
	t -= 1


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	for i in arr:
		if i ** 0.5 != int(i ** 0.5):
			print('YES')
			break
	else:
		print('NO')


import math
for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	flag = 0
	for i in range(n):
		root = math.sqrt(l[i])
		if int(root + 0.5) ** 2 == l[i]:
			continue
		else:
			flag = 1
	if flag == 1:
		print('YES')
	else:
		print('NO')


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import sys
input = sys.stdin.readline
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	n = val()
	cnt = Counter(li())
	ans = 0
	for i in cnt:
		temp = int(math.sqrt(i))
		if temp * temp != i:
			ans = 1
	print('YES' if ans else 'NO')


import math
from sys import stdin, stdout
input = stdin.readline

def solve():
	n = int(input())
	lis = list(map(int, input().split()))
	for i in lis:
		a = int(math.sqrt(i))
		if a * a != i:
			print('YES')
			return True
for _ in range(int(input())):
	if not solve():
		print('NO')


import heapq
import sys
from collections import *
from heapq import *
import math
import bisect

def input():
	return sys.stdin.readline()
perfect = [i * i for i in range(1, 10001)]
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = False
	for i in a:
		if i not in perfect:
			ans = True
			break
	if ans:
		print('YES')
	else:
		print('NO')


from collections import defaultdict
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def intArr():
	return map(int, input().split())

def In():
	return int(input())

def factorise(n):
	ans = defaultdict(int)
	for i in range(2, int(pow(n, 0.5)) + 2):
		if n % i == 0:
			while n % i == 0:
				ans[i] += 1
				n //= i
		if n == 1:
			return ans

def func(arr):
	n = len(arr)
	for i in range(n):
		a = arr[i]
		x = int(pow(arr[i], 0.5))
		if x * x != a and pow(x - 1, 2) != a and (pow(x + 1, 2) != a):
			return 'YES'
	return 'NO'

def main():
	for _ in range(In()):
		d1 = defaultdict(int)
		n = In()
		arr = list(intArr())
		print(func(arr))
	return
d1 = defaultdict(int)
main()


import sys
import math

def solve(n, nums):
	ans = 'NO'
	for i in nums:
		if not math.sqrt(i).is_integer():
			ans = 'YES'
	return ans
t = int(input())
for i in range(t):
	n = int(input())
	heights = [int(x) for x in input().split()]
	print(solve(n, heights))


import math

def mul(li):
	for i in range(len(li)):
		val = math.sqrt(li[i])
		if math.ceil(val) != math.floor(val):
			return True
	return False
for i in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	if mul(li):
		print('YES')
	else:
		print('NO')


from math import sqrt

def notperfect(num):
	rt = int(sqrt(num))
	return not rt * rt == num

def sol(arr):
	for a in arr:
		if notperfect(a):
			return 'YES'
	return 'NO'
for _ in range(int(input())):
	n = int(input())
	arr = [int(i) for i in input().split()]
	print(sol(arr))


t = int(input())
amax = 10 ** 4
sq = [False] * (amax + 1)
for x in range(0, amax):
	if x * x > amax:
		break
	sq[x * x] = True
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print('NO' if all([sq[x] for x in a]) else 'YES')


from math import *
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(n):
		p = sqrt(a[j])
		q = floor(p)
		if p - q > 1e-06:
			print('YES')
			break
		else:
			continue
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	num = input().split()
	num = [int(i) for i in num]
	yes = False
	for j in num:
		if j ** 0.5 != int(j ** 0.5):
			yes = True
			break
	if yes:
		print('YES')
	else:
		print('NO')


import math
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	squares = []
	for a in A:
		if math.sqrt(a).is_integer():
			squares.append(a)
	if len(squares) == n:
		print('NO')
	else:
		print('YES')


import math

def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	flag = 0
	for i in arr:
		a = int(math.sqrt(i))
		if a * a != i:
			flag = 1
	print('YES' if flag else 'NO')
tst = int(input())
for i in range(tst):
	solve()


t = int(input())
for i in range(0, t):
	n = int(input())
	import math
	a = list(map(int, input().split()))
	a.sort()
	f = 0
	for i in range(0, len(a)):
		k = math.sqrt(a[i])
		if k.is_integer() == False:
			f = 1
	if f == 1:
		print('YES')
	else:
		print('NO')


import math
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split(' ')))
	flag = 0
	for j in range(0, len(a)):
		x = math.floor(math.sqrt(a[j]))
		if x * x != a[j]:
			flag = 1
			break
	if flag:
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	cnt = 1
	for i in range(n):
		k = math.sqrt(a[i])
		if k % 1:
			cnt = 0
			break
	if cnt == 0:
		print('YES')
	else:
		print('NO')


for s in [*open(0)][2::2]:
	print('YNEOS'[all((x == int(x ** 0.5) ** 2 for x in map(int, s.split())))::2])


from math import sqrt
T = int(input())
for _ in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	correct = 'NO'
	for elt in A:
		if sqrt(elt) != int(sqrt(elt)):
			correct = 'YES'
			break
	print(correct)


import os.path
from math import gcd, floor, ceil
from collections import *
import sys
mod = 1000000007
INF = float('inf')

def st():
	return list(sys.stdin.readline().strip())

def li():
	return list(map(int, sys.stdin.readline().split()))

def mp():
	return map(int, sys.stdin.readline().split())

def inp():
	return int(sys.stdin.readline())

def pr(n):
	return sys.stdout.write(str(n) + '\n')

def prl(n):
	return sys.stdout.write(str(n) + ' ')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = inp()
	l = li()
	for i in l:
		a = i ** 0.5
		if ceil(a) != floor(a):
			pr('YES')
			return
	pr('NO')
for _ in range(inp()):
	solve()


for _ in range(int(input())):
	n = int(input())
	w = [int(i) for i in input().split()]
	for i in range(n):
		if (w[i] ** 0.5).is_integer() == False:
			print('YES')
			break
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	arr = [int(_) for _ in input().split()]
	c = 0
	for j in range(n):
		if (arr[j] ** 0.5).is_integer():
			c += 1
	if c == len(arr):
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	x = int(input())
	l = list(map(int, input().split()))
	for i in l:
		d = int(i ** (1 / 2))
		if d * d != i:
			print('YES')
			break
	else:
		print('NO')


def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	for i in range(n):
		x = arr[i] ** 0.5
		if x != int(x):
			print('YES')
			return 0
	print('NO')
	return 0
t = int(input())
for _ in range(t):
	solve()


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
from queue import PriorityQueue as pq
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	f = 0
	for i in l:
		p = math.sqrt(i)
		if p != int(p):
			f = 1
			break
	if f:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	flag = 0
	for i in a:
		if i ** (1 / 2) != int(i ** (1 / 2)):
			print('YES')
			flag = 1
			break
	if flag == 0:
		print('NO')


import math
t = int(input())
asnwers = []
for i in range(t):
	n = int(input())
	a = input().split(' ')
	for j in range(n):
		a[j] = int(a[j])
	b = False
	for j in range(n):
		x = int(math.sqrt(a[j]))
		if x ** 2 != a[j]:
			b = True
			break
	if b:
		asnwers.append('YES')
	else:
		asnwers.append('NO')
for i in range(t):
	print(asnwers[i])


from math import sqrt

def isPer(x):
	if int(sqrt(x) + 0.5) ** 2 == x:
		return True
	else:
		return False
n = int(input())
for _ in range(n):
	a = int(input())
	ls = list(map(int, input().split()))
	if any((not isPer(e) for e in ls)):
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for k in range(t):
	input()
	arr = list(map(int, input().split()))
	ans = 'NO'
	for i in arr:
		if math.sqrt(i) * 10 % 10 != 0:
			ans = 'YES'
			break
	print(ans)


import math

def get_int():
	return int(input())

def get_list_ints():
	return list(map(int, input().split()))

def get_char_list():
	s = input()
	return list(s[:len(s) - 1])

def get_tuple_ints():
	return tuple(map(int, input().split()))

def print_iterable(p):
	print(' '.join(map(str, p)))

def main():
	t = get_int()
	for i in range(t):
		f = 0
		n = get_int()
		a = get_list_ints()
		for j in range(n):
			p = math.sqrt(a[j])
			if p != int(p):
				f = 1
				break
			else:
				f = 0
		if f == 1:
			print('YES')
		else:
			print('NO')
main()


import math

def is_square(integer):
	root = math.sqrt(integer)
	return integer == int(root + 0.5) ** 2
cases = int(input())
for case in range(0, cases):
	n = int(input())
	array = [int(x) for x in input().split(' ')]
	x = 0
	for num in array:
		if not is_square(num):
			print('Yes')
			x = 1
			break
	if x == 0:
		print('No')


t = int(input())
for nbt in range(t):
	n = [int(i) for i in input().split()][0]
	a = [int(i) for i in input().split()]
	isok = False
	for i in a:
		if int((i + 0.5) ** 0.5) ** 2 != i:
			isok = True
			break
	if isok:
		print('YES')
	else:
		print('NO')


def is_square(number):
	if int(number ** 0.5) ** 2 == number:
		return True
	else:
		return False
t = int(input())
for _ in range(t):
	input()
	numbers = list(map(int, input().split()))
	for number in numbers:
		if not is_square(number):
			print('YES')
			break
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ok = False
	for x in a:
		y = int(math.sqrt(x))
		if y * y != x:
			ok = True
	if ok:
		print('YES')
	else:
		print('NO')


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split()]
	f = 0
	for i in l:
		x = sqrt(i)
		if int(x) ** 2 != i:
			f = 1
			break
	if f == 0:
		print('NO')
	else:
		print('YES')


from math import ceil
num = int(input())
for _ in range(num):
	n = int(input())
	ans = False
	for i in map(int, input().split()):
		if int(i ** 0.5) != ceil(i ** 0.5):
			ans = True
			break
	print('YES' if ans else 'NO')


ls = []
for i in range(1, 101):
	ls.append(i * i)
T = int(input())
for _ in range(T):
	n = int(input())
	flag = 1
	x = input().split()
	x = [int(m) for m in x]
	for j in x:
		if j not in ls:
			flag = 0
			break
	if flag:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	n = int(input())
	s = [int(a) for a in input().split()]
	for e in s:
		if e ** 0.5 % 1 != 0:
			print('YES')
			break
	else:
		print('NO')


from math import ceil, floor, sqrt
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	c = 0
	for i in l:
		if floor(sqrt(i)) != ceil(sqrt(i)):
			c = 1
	if c == 1:
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	a = int(input())
	s = list(map(int, input().split()))
	f = 0
	for x in s:
		y = math.sqrt(x)
		if int(y + 0.5) ** 2 != x:
			f = 1
			break
	if f == 1:
		print('YES')
	else:
		print('NO')


from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)

def I():
	return int(stdin.readline())

def lint():
	return [int(x) for x in stdin.readline().split()]

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]
from collections import defaultdict, Counter
import math
from itertools import groupby

def gcd(a, b):
	while b:
		a %= b
		tmp = a
		a = b
		b = tmp
	return a

def lcm(a, b):
	return a / gcd(a, b) * b
t = I()
for _ in range(t):
	n = I()
	f = False
	s = lint()
	for i in range(n):
		if int(math.sqrt(s[i])) ** 2 != s[i]:
			f = True
			break
	if f:
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	n = int(input())
	for n in map(int, input().split()):
		tmp = math.sqrt(n)
		if tmp != tmp // 1:
			print('YES')
			break
	else:
		print('NO')


import math
for i in range(int(input())):
	al = int(input())
	a = list(map(int, input().split()))
	c = 1
	for i in a:
		if (i ** 0.5).is_integer() == False:
			print('YES')
			break
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	data = list(map(int, input().split()))
	YES = False
	for i in data:
		if not (i ** 0.5).is_integer():
			YES = True
			break
	if YES:
		print('YES')
	else:
		print('NO')


import math as m
R = lambda : int(input())
S = lambda : [int(a) for a in input().split()]
for _ in range(R()):
	n = R()
	a = S()
	flag = 0
	for i in range(n):
		if str(m.sqrt(a[i]))[-1] != '0':
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


from math import *

def s(ll, n):
	for i in range(n):
		if floor(sqrt(ll[i])) != ceil(sqrt(ll[i])):
			return 'YES'
	return 'NO'
for _ in range(int(input())):
	n = int(input())
	ll = list(map(int, input().split()))
	print(s(ll, n))


def is_sq(x: int) -> bool:
	sqx = int(x ** 0.5)
	if sqx ** 2 == x:
		return True
	return False

def solve():
	input()
	a = [is_sq(int(x)) for x in input().split()].count(False)
	print('YES' if a else 'NO')
for _ in range(int(input())):
	solve()


d = dict()
for j in range(1, 1000001):
	d[j * j] = 1
t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	s = 0
	for k in range(n):
		if l[k] not in d.keys():
			s += 1
			break
	if s == 0:
		print('NO')
	else:
		print('YES')


import math

def is_duplicate(arr, element):
	x = 0
	for a in arr:
		if a == element:
			x += 1
	return x > 1

def run(arr):
	arr = set(arr)
	for x in arr:
		if math.sqrt(x) == int(math.sqrt(x)):
			continue
		else:
			return 'YES'
	return 'NO'
testCases = int(input())
for i in range(0, testCases):
	x = input()
	arr = input().split(' ')
	print(run([int(val) for val in arr]))


import math
test_cases = int(input())
for i in range(test_cases):
	length_of_a = int(input())
	elements_of_array_a = list(map(int, input().split(' ')))
	square_numbers = 0
	for number in elements_of_array_a:
		if math.sqrt(number) != int(math.sqrt(number)):
			square_numbers += 1
	if square_numbers > 0:
		print('YES')
	else:
		print('NO')


mp = {}
for i in range(10 ** 3):
	mp[i * i] = i
T = int(input())
for t in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	flag = 'NO'
	for a in A:
		if a not in mp:
			flag = 'YES'
			break
	print(flag)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def matching(s):
	le = len(s)
	pi = [0] * le
	for i in range(1, le):
		j = pi[i - 1]
		while j > 0 and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	w = set()
	i = le - 1
	while pi[i] != 0:
		w.add(le - pi[i])
		i = pi[i] - 1
	return w
from heapq import heapify, heapreplace, heappop, heappush
from collections import Counter, defaultdict
import math
for _ in range(int(input())):
	n = int(input())
	array = list(map(int, input().split()))
	f = 0
	for i in range(n):
		if array[i] != int(array[i] ** 0.5) ** 2:
			f = 1
	print('YES' if f == 1 else 'NO')


import math
t = int(input())
for i in range(t):
	n = int(input())
	l = [int(j) for j in input().split()]
	c = 1
	for j in range(len(l)):
		x = math.sqrt(l[j])
		if int(x + 0.5) ** 2 != l[j]:
			c = 2
			break
	if c == 1:
		print('NO')
	elif c == 2:
		print('YES')


import math
num = int(input())
for i in range(num):
	n = int(input())
	arr = input()
	arr = arr.split(' ')
	arr = [int(x) for x in arr if not math.sqrt(int(x)).is_integer()]
	if len(arr) > 0:
		print('YES')
	else:
		print('NO')


from math import *
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	for i in range(n):
		z = int(sqrt(l[i]))
		if z * z != l[i]:
			print('YES')
			break
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for i in a:
		i = i ** 0.5
		z = str(i).split('.')
		if z[1] != '0':
			print('YES')
			break
	else:
		print('NO')


import math
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	flag = False
	for i in range(n):
		if math.floor(math.sqrt(a[i])) != math.sqrt(a[i]):
			flag = True
			print('YES')
			break
	if flag == False:
		print('NO')


import sys
import math
from bisect import bisect_left
import heapq
from collections import deque

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()

def FACT(n, mod):
	s = 1
	facts = [1]
	for i in range(1, n + 1):
		s *= i
		s %= mod
		facts.append(s)
	return facts[n]

def C(n, k, mod):
	return FACT(n, mod) * pow(FACT(k, mod) * FACT(n - k, mod) % mod, mod - 2, mod) % mod

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
for _ in range(II()):
	n = II()
	a = LI()
	boo = False
	for i in range(n):
		if a[i] ** 0.5 != int(a[i] ** 0.5):
			boo = True
	print('YES' if boo else 'NO')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	c = 0
	for i in li:
		x = int(math.sqrt(i))
		if x * x == i:
			c += 1
	if c == n:
		print('NO')
	else:
		print('YES')


t = int(input())
a_ = []
for i in range(t):
	x = int(input())
	y = input()
	a_.append(y.split())
for i in range(t):
	f = False
	a = a_[i]
	for i in a:
		i = int(i)
		if i ** 0.5 % 1 != 0:
			f = True
			break
	if f:
		print('YES')
	else:
		print('NO')


from math import sqrt
list1 = []
for i in range(int(input())):
	n = int(input())
	t = True
	s = list(map(lambda x: int(x), input().split()))
	for j in s:
		if str(sqrt(j)).endswith('.0'):
			continue
		else:
			list1.append('YES')
			t = False
			break
	if t:
		list1.append('NO')
print(*list1, sep='\n')


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	for ele in arr:
		ans = sqrt(ele)
		ans = int(ans)
		if ans * ans != ele:
			print('YES')
			break
	else:
		print('NO')


MOD = 1000007

def input_int_list():
	return list(map(int, input().split()))

def input_int_asMap():
	return map(int, input().split())

def input_float_list():
	return list(map(float, input().split()))

def input_float_asMap():
	return map(float, input().split())

def input_str_list():
	return list(input().split())

def input_str_asMap():
	return map(str, input().split())

def solve():
	n = int(input())
	nums = input_int_list()
	for num in nums:
		intSqrt = int(num ** (1 / 2))
		if num != intSqrt ** 2:
			return 'YES'
	return 'NO'
OUTPUTS = []

def print_output(outputs, n=None):
	numOutputs = n if n != None else len(outputs)
	for i in range(numOutputs):
		print(outputs[i])
testCases = int(input())
for _ in range(testCases):
	OUTPUTS.append(solve())
print_output(OUTPUTS)


from itertools import combinations
t = int(input())

def prod(tup):
	res = 1
	for t in tup:
		res *= t
	return res

def psq(num):
	sqr = num ** 0.5
	if int(sqr) - sqr == 0:
		return 1
	else:
		return 0
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a = [aa for aa in a if not psq(aa)]
	j = 1
	solve = 1
	while solve and j <= n:
		combs = combinations(a, j)
		for comb in combs:
			pd = prod(comb)
			if not psq(pd):
				solve = 0
				break
			else:
				continue
		j += 1
	if solve == 1:
		print('NO')
	else:
		print('YES')


import math
for I in range(int(input())):
	m = int(input())
	n = list(map(int, input().split()))
	q = 'NO'
	for i in range(m):
		a = math.sqrt(n[i])
		b = math.ceil(a)
		if a != b and n[i] != 1:
			q = 'YES'
			break
	print(q)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	gotcha = False
	product = 1
	for i in A:
		if i != 0:
			if i ** 0.5 != int(i ** 0.5):
				print('YES')
				gotcha = True
				break
			product *= i
	if i ** 0.5 != int(i ** 0.5) and (not gotcha):
		print('YES')
	elif not gotcha:
		print('NO')


import math
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	c = 0
	for i in range(n):
		x = a[i]
		y = x ** 0.5
		b = math.floor(y)
		if y == b:
			pass
		else:
			c = 1
			print('YES')
			break
	if c == 0:
		print('NO')