Given some numbers, can you tell, if the product of these numbers are a perfect square or not?
A number is called perfect square if it can be obtained by multiplying the same number twice. The first few perfect square numbers are 1, 4, 9, 16, 25, 36, 49.
The first line contains an integer (), denoting the number of the test case.
Each test case contains an integer (), denoting how many numbers to compute. And below that an array () consisting of numbers will be given.
You have to find if the product of the array is a perfect square or not. If the product is a perfect square print otherwise print .
3 1 100 2 5 9 5 1 2 3 4 5
YES NO NO
Login to submit
the frequency of prime factors in a perfect square is always even. you can find that if you do some ...