#C6013. Product of Distinct Integers

    ID: 49727 Type: Default 1000ms 256MiB

Product of Distinct Integers

Product of Distinct Integers

You are given a positive integer n. Your task is to determine whether n can be represented as a product of two or more distinct integers greater than 1. In other words, check if there exist at least two different integers a and b (with a, b > 1 and a ≠ b) such that n = a × b × ....

Note: The factors in the representation must be distinct. For example, although 4 = 2 × 2, it does not satisfy the condition since the factors are not different.

Examples:

  • 6 can be represented as 2 × 3, so the answer is YES.
  • 30 can be represented as 2 × 3 × 5, so the answer is YES.
  • 10 can be represented as 2 × 5, so the answer is YES.
  • 7 is prime and cannot be represented as required, so the answer is NO.
  • 1 does not have any valid factorization, so the answer is NO.

The mathematical condition can be formally written in LaTeX as:

$$n = a_1 \times a_2 \times \cdots \times a_k \quad \text{with} \quad k \geq 2, \quad \forall i,\ a_i > 1, \quad \text{and} \quad a_i \neq a_j \ (i \neq j). $$

inputFormat

The first line of input contains an integer t denoting the number of test cases. Each of the following t lines contains a single integer n (1 ≤ n ≤ 109).

outputFormat

For each test case, output a single line containing YES if n can be represented as a product of two or more distinct integers greater than 1, otherwise output NO.

## sample
5
6
30
10
7
1
YES

YES YES NO NO

</p>