#P6274. [eJOI 2017] 六
[eJOI 2017] 六
Description
Elly is studying some properties of a positive integer , and she finds that has no more than distinct prime factors.
Next, she generates a list in a special way. The list is empty at the beginning. Each time, she writes down a divisor of that is greater than and adds it to the list. Before adding , she must ensure that among all numbers already in the list, there are no more than number that is not coprime with .
For example, when :
Valid lists include: $(42), (616, 6, 91, 23),(91, 616, 6, 23), (66, 7), (66, 7, 7, 23, 299, 66), \\(143, 13, 66),(42,12156144),\text{etc.}$
Invalid lists include: , because is not a divisor of ; and , because is not coprime with both of the other numbers.
Now Elly wants you to compute, for a given , how many different valid lists can be generated.
We say two lists are different if their lengths are different, or if there exists a position where the values at that position are different.
Input Format
One integer: .
Output Format
One integer, the number of lists modulo .
6
28
203021
33628
60357056536
907882
12156144
104757552
Hint
【Explanation of Samples】
Sample 1 Explanation
The lists that satisfy the condition are: $(2), (2, 2), (2, 2, 3), (2, 2, 3, 3), (2, 3), (2, 3, 2), (2, 3, 2, 3), (2, 3, 3), (2, 3, 3, 2), \\ (2, 6), (2, 6,3), (3), (3, 2), (3, 2, 2), (3, 2, 2, 3), (3, 2, 3), (3, 2, 3, 2), (3, 3),\\ (3, 3, 2), (3, 3, 2,2), (3, 6), (3, 6, 2), (6), (6, 2), (6, 2, 3), (6, 3), (6, 3, 2), (6, 6)$.
There are lists in total.
Sample 4 Explanation
The real answer is .
Output .
【Constraints and Notes】
- For all testdata, it is guaranteed that .
- For about of the testdata, has at most prime factors.
- For about of the testdata, has at most prime factors.
- For of the testdata, has at most prime factors.
【Notes】
The original problem is from: eJOI 2017 Problem B Six.
Translation provided by: @_Wallace_.
Translated by ChatGPT 5
京公网安备 11011102002149号