Product of Squares

Product of Squares
easy

You are given an integer \(N\), followed by \(N\) positive integers. For each given integer \(A\), determine if it can be represented as the product of two perfect squares, both strictly greater than \(1\). Formally, you need to check if there exist integers \(x > 1\) and \(y > 1\) such that:

\[A = x^2 \cdot y^2\]

Input:

  • The first line contains an integer \(N\).
  • The next \(N\) lines contain the integers \(A\) to be checked.

Output:

  • For each integer \(A\), print “YES” if it satisfies the condition, and “NO” otherwise.

Constraints:

  • \(1 \leq N \leq 1000\)
  • \(1 \leq A \leq 10^{18}\)

If this task is to hard for you, try solving it when * \(1 \leq A \leq 10^9\)

Or, if it’s still too hard, try solving it when * \(1 \leq A \leq 10^4\)

Example:

Input:

3
9
144
234

Output:

NO 
YES
NO