#P6274. [eJOI 2017] 六

[eJOI 2017] 六

Description

Elly is studying some properties of a positive integer NN, and she finds that NN has no more than 66 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 xx of NN that is greater than 11 and adds it to the list. Before adding xx, she must ensure that among all numbers already in the list, there are no more than 11 number that is not coprime with xx.


For example, when N=12156144N=12156144:

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: (5,11)(5,11), because 55 is not a divisor of NN; and (66,13,143) (66, 13, 143), because 143143 is not coprime with both of the other numbers.


Now Elly wants you to compute, for a given NN, 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: NN.

Output Format

One integer, the number of lists modulo (109+7)(10^9+7).

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 2828 lists in total.

Sample 4 Explanation

The real answer is 1410475765014104757650.

Output 14104757650mod(109+7)=10475755214104757650 \bmod (10^9+7)=104757552.

【Constraints and Notes】

  • For all testdata, it is guaranteed that 1N10151\le N\le 10^{15}.
  • For about 30%30\% of the testdata, NN has at most 22 prime factors.
  • For about 60%60\% of the testdata, NN has at most 44 prime factors.
  • For 100%100\% of the testdata, NN has at most 66 prime factors.

【Notes】

The original problem is from: eJOI 2017 Problem B Six.

Translation provided by: @_Wallace_.

Translated by ChatGPT 5