QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB Total points: 100 Hackable ✓

#13642. 人类的本质

统计

小A和小C在玩一个游戏,每次小A从$1$~$n$中任意选择一个数$i$,然后小C从$1$~$i$中任意选择一个数$x$,这将会产生$\gcd(i,x)$的价值。众所周知,小C是一个复读机,他会重复$k$次这样的操作,游戏的总价值为每次小C产生价值的最小公倍数。

现在小A想要知道所有情况下游戏总价值的和是多少,由于一些显而易见的原因,你只需要求出在模$10^9+7$意义下的和即可。

输入格式

一行两个正整数$n,k$。

输出格式

一行一个整数,表示游戏的价值和。

样例一

input

3 1

output

9

explanation

对于Sample Input 1 价值为 $\gcd(1,1)+\gcd(2,1)+\gcd(2,2)+\gcd(3,1)+\gcd(3,2)+\gcd(3,3)=9$

样例二

input

5 2

output

130

样例三

input

1000000 1000

output

763267594

限制与约定

$1 \le n \le 10^9, 1 \le k \le 10^9, 1 \le n*k \le 10^9$

本题使用子任务评测(空则表示无特殊性质)

子任务分值$n$$k$
15$\leq 10^6$$= 1$
25 $= 1$
37$\leq 10^6$$= 2$
48 $= 2$
535$\leq 10^7$ 
640  
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.