QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#6967. 游戏

الإحصائيات

九条可怜是一个富有的女孩子。她长大以后创业了,开了一个公司。 但是管理公司是一个很累人的活,员工们经常背着可怜偷懒,可怜需要时不时对办公室进行检查。

可怜公司有 $n$ 个办公室,办公室编号是 $l\sim l+n-1$ ,可怜会事先制定一个顺序,按照这个顺序依次检查办公室。一开始的时候,所有办公室的员工都在偷懒,当她检查完编号是 $i$ 的办公室时候,这个办公室的员工会认真工作,并且这个办公室的员工通知所有办公室编号是 $i$ 的倍数的办公室,通知他们老板来了,让他们认真工作。因此,可怜检查完第 $i$ 个办公室的时候,所有编号是 $i$ 的倍数(包括 $i$ )的办公室的员工会认真工作。

可怜发现了员工们通风报信的行为,她发现,对于每种不同的顺序 $p$ ,都存在一个最小的 $t(p)$ ,使得可怜按照这个顺序检查完前 $t(p)$ 个办公室之后,所有的办公室都会开始认真工作。她把这个 $t(p)$ 定义为 $p$ 的检查时间。

可怜想知道所有 $t(p)$ 的和。

但是这个结果可能很大,她想知道和对 $10^9+7$ 取模后的结果。

输入格式

第一行输入两个整数 $l,r$ 表示编号范围,题目中的 $n$ 就是 $r-l+1$ 。

输出格式

一个整数,表示所有 $t(p)$ 的和。

样例数据

样例 1 输入

2 4

样例 1 输出

16

样例 1 解释

考虑所有办公室被检查的相对顺序:

  • 2 3 4,时间是 $2$。
  • 3 2 4,时间是 $2$。
  • 4 2 3,时间是 $3$。
  • 4 3 2,时间是 $3$。
  • 2 4 3,时间是 $3$。
  • 3 4 2,时间是 $3$。

和是 $16$ 。

样例 2 输入

4 12

样例 2 输出

3110400

子任务

对于 $20\%$ 的数据,$r-l+1\leq 8$。

对于另 $10\%$ 的数据,$l=1$。

对于另 $10\%$ 的数据,$l=2$。

对于另 $30\%$ 的数据,$l\leq 200$。

对于 $100\%$ 的数据,$1\leq l\leq r\leq 10^7$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.