#P4562. [JXOI2018] 游戏

    ID: 3463 远端评测题 1000ms 500MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>数学2018各省省选组合数学期望

[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 nn offices, numbered from ll to l+n1l + n - 1. 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 ii, the employees in that office start to work hard, and they also notify all offices whose numbers are multiples of ii to let them know the boss is here and start working. Therefore, after she finishes inspecting office ii, all offices whose numbers are multiples of ii (including ii itself) will have their employees working hard.

Kelian discovered this behavior of passing along the message. She found that for every different order pp, there exists a smallest t(p)t(p) such that after she finishes inspecting the first t(p)t(p) offices according to this order, all offices will have started working hard. She defines this t(p)t(p) as the inspection time of pp.

Kelian wants to know the sum of all t(p)t(p).

Since the result can be large, she wants the sum modulo 109+710^9 + 7.

Input Format

The first line contains two integers l,rl, r indicating the numbering range. In the problem, nn is rl+1r - l + 1.

Output Format

Output a single integer, the sum of all t(p)t(p).

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 1616.

Constraints

  • For 20% of the testdata, rl+18r - l + 1 \leq 8.
  • For another 10% of the testdata, l=1l = 1.
  • For another 10% of the testdata, l=2l = 2.
  • For another 30% of the testdata, l200l \leq 200.
  • For 100% of the testdata, 1lr1071 \leq l \leq r \leq 10^7.

Translated by ChatGPT 5