CF1097D.Makoto and a Blackboard
提高+/省选-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Makoto has a big blackboard with a positive integer n written on it. He will perform the following action exactly k times:
Suppose the number currently written on the blackboard is v. He will randomly pick one of the divisors of v (possibly 1 and v) and replace v with this divisor. As Makoto uses his famous random number generator (RNG) and as he always uses 58 as his generator seed, each divisor is guaranteed to be chosen with equal probability.
He now wonders what is the expected value of the number written on the blackboard after k steps.
It can be shown that this value can be represented as QP where P and Q are coprime integers and Q≡0(mod109+7). Print the value of P⋅Q−1 modulo 109+7.
诚司有一块大黑板,上面写有一个正整数 n。他将恰好执行以下操作 k 次:
假设当前黑板上写的数为 v。他将随机选取 v 的一个正因数(包括 1 和 v 本身),并用该因数替换 v。由于诚司使用他著名的随机数生成器(RNG),且始终以 58 作为生成器种子,因此每个因数被选中的概率均等。
他现在想知道:经过 k 步操作后,黑板上所写数字的期望值是多少?
可以证明,该期望值可表示为最简分数 QP,其中 P 与 Q 互质,且 Q≡0(mod109+7)。请输出 P⋅Q−1mod(109+7) 的值。
输入格式
The only line of the input contains two integers n and k (1≤n≤1015, 1≤k≤104).
输入仅包含一行,其中有两个整数 n 和 k(1≤n≤1015,1≤k≤104)。
输出格式
Print a single integer — the expected value of the number on the blackboard after k steps as P⋅Q−1(mod109+7) for P, Q defined above.
输出一个整数——即经过 k 步后黑板上数字的期望值,表示为 P⋅Q−1(mod109+7),其中 P、Q 如上所定义。
输入输出样例
输入#1
6 1
输出#1
3
输入#2
6 2
输出#2
875000008
输入#3
60 5
输出#3
237178099
说明/提示
In the first example, after one step, the number written on the blackboard is 1, 2, 3 or 6 — each occurring with equal probability. Hence, the answer is 41+2+3+6=3.
In the second example, the answer is equal to 1⋅169+2⋅163+3⋅163+6⋅161=815.
在第一个例子中,经过一步操作后,黑板上写的数字为 1、2、3 或 6——每种结果出现的概率相等。因此,答案为 41+2+3+6=3。
在第二个例子中,答案等于 1⋅169+2⋅163+3⋅163+6⋅161=815。
输入解题思路,AI测评打分。不知道怎么写?