#K84862. Perfect Square Check
Perfect Square Check
Perfect Square Check
You are given a sequence of N integers. For each integer n in the sequence, determine whether it is a perfect square. In mathematical terms, a number n is a perfect square if there exists an integer k such that \( n = k^2 \). For every number in the given sequence, print YES
if it is a perfect square and NO
otherwise.
inputFormat
The first line of input contains a single integer N, representing the number of integers. The second line contains N space-separated integers.
Example:
5 1 2 3 4 16
outputFormat
Output N lines. Each line should contain YES
if the corresponding input integer is a perfect square, or NO
if it is not.
Example:
YES NO NO YES YES## sample
5
1 2 3 4 16
YES
NO
NO
YES
YES
</p>