Given a cluster an of length n, let us know whether it has a non-void aftereffect with the end goal that the result of its components is certifiably not an ideal square. A grouping b is an aftereffect of a cluster an if b can be gotten from a by erasing a few (perhaps zero) components.
Correct answer will be upvoted else downvoted.
Given a cluster an of length n, let us know whether it has a non-void aftereffect with the end goal that the result of its components is certifiably not an ideal square.
A grouping b is an aftereffect of a cluster an if b can be gotten from a by erasing a few (perhaps zero) components.
Input
The principal line contains an integer t (1≤t≤100) — the number of experiments. The depiction of the experiments follows.
The principal line of each experiment contains an integer n (1≤n≤100) — the length of the exhibit a.
The second line of each experiment contains n integers a1, a2, … , an (1≤
Output
In case there's an aftereffect of a whose item is certainly not an ideal square, print "YES". In any case, print "NO".
Step by step
Solved in 3 steps with 1 images