QOJ.ac

QOJ

时间限制: 1 s 内存限制: 512 MB 总分: 100

#6967. Game

统计

Kelia is a wealthy girl. After growing up, she started her own business and opened a company. However, managing a company is exhausting work. Employees often slack off behind Kelia's back, so she needs to inspect the offices from time to time.

Kelia's company has $n$ offices, numbered from $l$ to $l+n-1$. Kelia predetermines an order and inspects the offices one by one according to this sequence. Initially, all employees are slacking off. When she finishes inspecting the office with number $i$, the employees in that office start working diligently, and they notify all offices with numbers that are multiples of $i$ that the boss has arrived, telling them to work diligently. Therefore, when Kelia finishes inspecting the $i$-th office, the employees in all offices with numbers that are multiples of $i$ (including $i$ itself) will start working diligently.

Kelia discovered this behavior of the employees tipping each other off. She found that for every different permutation $p$, there exists a minimum $t(p)$ such that after Kelia finishes inspecting the first $t(p)$ offices in this order, all offices start working diligently. She defines this $t(p)$ as the inspection time of $p$.

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

Since this result might be very large, she wants to know the sum modulo $10^9+7$.

Input

The first line contains two integers $l$ and $r$ representing the range of office numbers, where $n = r-l+1$.

Output

A single integer representing the sum of all $t(p)$ modulo $10^9+7$.

Examples

Input 1

2 4

Output 1

16

Note 1

Consider all relative orders of office inspections:

  • 2 3 4, time is $2$.
  • 3 2 4, time is $2$.
  • 4 2 3, time is $3$.
  • 4 3 2, time is $3$.
  • 2 4 3, time is $3$.
  • 3 4 2, time is $3$.

The sum is $16$.

Input 2

4 12

Output 2

3110400

Subtasks

For $20\%$ of the data, $r-l+1 \leq 8$.

For another $10\%$ of the data, $l=1$.

For another $10\%$ of the data, $l=2$.

For another $30\%$ of the data, $l \leq 200$.

For $100\%$ of the data, $1 \leq l \leq r \leq 10^7$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.