#P4562. [JXOI2018] 游戏
[JXOI2018] 游戏
Description
After growing up, she started a business and founded a company. However, managing a company is exhausting. Employees often slack off behind Kelian’s back, so she has to inspect the offices from time to time.
Kelian’s company has offices, numbered from to . Kelian will decide an order in advance and inspect the offices one by one according to this order. At the beginning, all employees in all offices are slacking off. When she finishes inspecting the office with number , the employees in that office start to work hard, and they also notify all offices whose numbers are multiples of to let them know the boss is here and start working. Therefore, after she finishes inspecting office , all offices whose numbers are multiples of (including itself) will have their employees working hard.
Kelian discovered this behavior of passing along the message. She found that for every different order , there exists a smallest such that after she finishes inspecting the first offices according to this order, all offices will have started working hard. She defines this as the inspection time of .
Kelian wants to know the sum of all .
Since the result can be large, she wants the sum modulo .
Input Format
The first line contains two integers indicating the numbering range. In the problem, is .
Output Format
Output a single integer, the sum of all .
2 4
16
Hint
Sample Explanation
Consider all relative orders in which the offices are inspected:
{2, 3, 4}, the time is 2.
{3, 2, 4}, the time is 2.
{4, 2, 3}, the time is 3.
{4, 3, 2}, the time is 3.
{2, 4, 3}, the time is 3.
{3, 4, 2}, the time is 3.
The sum is .
Constraints
- For 20% of the testdata, .
- For another 10% of the testdata, .
- For another 10% of the testdata, .
- For another 30% of the testdata, .
- For 100% of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号