#P8448. [LSOT-1] 暴龙的土豆
[LSOT-1] 暴龙的土豆
Background
The Tyrannosaurus loves eating potatoes.
Problem Description
Given a positive integer .
In each operation, you may choose two primes , where must be an odd prime.
Let . If divides , then it counts as one valid operation, and becomes .
Now you need to answer: for a given , 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 .
The next lines each contain a positive integer .
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: can be written as , so one operation can be performed. But can only be written as , 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$;
- No special constraints.
For of the testdata, and .
Translated by ChatGPT 5