#K93437. Subarray Prime Perfect Square

    ID: 38419 Type: Default 1000ms 256MiB

Subarray Prime Perfect Square

Subarray Prime Perfect Square

Given an array of integers, determine whether there exists at least one contiguous subarray such that the product of all its elements is both a prime number and a perfect square.

In mathematical terms, we are looking for a subarray whose product, (p), satisfies the following conditions:
(p) is a prime number, and
(p = k^2) for some integer (k).

Note that no number greater than 1 can be both a prime and a perfect square. Therefore, the answer for every test case is expected to be "NO".

inputFormat

The input is given on standard input and consists of multiple test cases. The first line contains an integer (T) ((1 \leq T \leq 10)), the number of test cases. For each test case, the first line contains an integer (n) ((1 \leq n \leq 10^5)) denoting the size of the array. The next line contains (n) space-separated integers representing the elements of the array.

outputFormat

For each test case, print a single line containing "NO" if no subarray satisfies the condition (which will always be the case given the constraints of the problem).## sample

2
5
2 3 5 7 11
4
4 6 8 10
NO

NO

</p>