#P9063. [yLOI2023] 分解只因数

[yLOI2023] 分解只因数

Problem Description

Given a positive integer nn, factorize nn into prime factors.

Let $n = p_1 \times p_2 \times p_3 \times \dots \times p_x$, where each pip_i is a prime number.

If all pip_i are odd, then nn is called a “Zhi Factor Number” (“只因数”).

Now, given several values of nn, determine whether nn is a “Zhi Factor Number”.

Input Format

This problem contains multiple groups of testdata within a single test case.

The first line contains an integer TT, the number of testdata groups.

The next TT lines each contain an integer nn, representing one group of data.

Output Format

For each group of data, output one string per line. If nn is a “Zhi Factor Number”, output Yes; otherwise output No.

5
2
3
4
6
9
No
Yes
No
No
Yes

Hint

Constraints

There are 1010 test points in total. For the ii-th test point, T=max(1,i1)T = \max(1, i - 1).

  • For 30%30\% of the data, n3n \leq 3.
  • For 50%50\% of the data, n10n \leq 10.
  • For another 10%10\% of the data, nn is odd.
  • For another 10%10\% of the data, nn is even.
  • For 90%90\% of the data, n109n \leq 10^9.
  • For 100%100\% of the data, 1T91 \leq T \leq 9, 2n10182 \leq n \leq 10^{18}.

Notes

There are two additional sample files for this problem. See ibvl.zip in the attachments.

Translated by ChatGPT 5