#P8448. [LSOT-1] 暴龙的土豆

[LSOT-1] 暴龙的土豆

Background

The Tyrannosaurus loves eating potatoes.

Problem Description

Given a positive integer nn.

In each operation, you may choose two primes y,zy, z, where zz must be an odd prime.

Let x=yzx = y^z. If xx divides nn, then it counts as one valid operation, and nn becomes nx\dfrac{n}{x}.

Now you need to answer: for a given nn, what is the maximum number of valid operations that can be performed.

Input Format

This problem contains multiple test cases.

The first line contains a positive integer TT.

The next TT lines each contain a positive integer nn.

Output Format

For each test case, output the answer.

2
16
9
1
0
2
1327104
3623878656000
5
12

Hint

[Sample Explanation]

For sample 1: 1616 can be written as 23×22^3 \times 2, so one operation can be performed. But 99 can only be written as 323^2, so no operation can be performed.

[Constraints]

"This problem uses bundled testdata."

  • $\texttt{Subtask 1(10 pts):}1 \le\ n\le 10^2,1 \le\ T\le 10^2$;
  • $\texttt{Subtask 2(20 pts):}1 \le\ n\le 10^6,1 \le\ T\le 10^2$;
  • $\texttt{Subtask 3(30 pts):}1 \le\ n\le 10^{12},1 \le\ T\le 10^2$;
  • Subtask 4(40 pts):\texttt{Subtask 4(40 pts):}No special constraints.

For 100%100\% of the testdata, 1n10181 \le n \le 10^{18} and 1T1021 \le T \le 10^2.

Translated by ChatGPT 5