CF1097D.Makoto and a Blackboard

提高+/省选-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Makoto has a big blackboard with a positive integer nn written on it. He will perform the following action exactly kk times:

Suppose the number currently written on the blackboard is vv. He will randomly pick one of the divisors of vv (possibly 11 and vv) and replace vv with this divisor. As Makoto uses his famous random number generator (RNG) and as he always uses 5858 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 kk steps.

It can be shown that this value can be represented as PQ\frac{P}{Q} where PP and QQ are coprime integers and Q≢0(mod109+7)Q \not\equiv 0 \pmod{10^9+7}. Print the value of P⋅Q−1P \cdot Q^{-1} modulo 109+710^9+7.

诚司有一块大黑板,上面写有一个正整数 nn。他将恰好执行以下操作 kk 次:

假设当前黑板上写的数为 vv。他将随机选取 vv 的一个正因数(包括 11 和 vv 本身),并用该因数替换 vv。由于诚司使用他著名的随机数生成器(RNG),且始终以 5858 作为生成器种子,因此每个因数被选中的概率均等。

他现在想知道:经过 kk 步操作后,黑板上所写数字的期望值是多少?

可以证明,该期望值可表示为最简分数 PQ\frac{P}{Q},其中 PP 与 QQ 互质,且 Q≢0(mod109+7)Q \not\equiv 0 \pmod{10^9+7}。请输出 P⋅Q−1 mod (109+7)P \cdot Q^{-1} \bmod (10^9+7) 的值。

输入格式

The only line of the input contains two integers nn and kk (1≤n≤10151 \leq n \leq 10^{15}, 1≤k≤1041 \leq k \leq 10^4).

输入仅包含一行,其中有两个整数 nn 和 kk(1≤n≤10151 \leq n \leq 10^{15},1≤k≤1041 \leq k \leq 10^4)。

输出格式

Print a single integer — the expected value of the number on the blackboard after kk steps as P⋅Q−1(mod109+7)P \cdot Q^{-1} \pmod{10^9+7} for PP, QQ defined above.

输出一个整数——即经过 kk 步后黑板上数字的期望值,表示为 P⋅Q−1(mod109+7)P \cdot Q^{-1} \pmod{10^9+7},其中 PP、QQ 如上所定义。

输入输出样例

  • 输入#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 11, 22, 33 or 66 — each occurring with equal probability. Hence, the answer is 1+2+3+64=3\frac{1+2+3+6}{4}=3.

In the second example, the answer is equal to 1⋅916+2⋅316+3⋅316+6⋅116=1581 \cdot \frac{9}{16}+2 \cdot \frac{3}{16}+3 \cdot \frac{3}{16}+6 \cdot \frac{1}{16}=\frac{15}{8}.

在第一个例子中,经过一步操作后,黑板上写的数字为 11、22、33 或 66——每种结果出现的概率相等。因此,答案为 1+2+3+64=3\frac{1+2+3+6}{4}=3。

在第二个例子中,答案等于 1⋅916+2⋅316+3⋅316+6⋅116=1581 \cdot \frac{9}{16}+2 \cdot \frac{3}{16}+3 \cdot \frac{3}{16}+6 \cdot \frac{1}{16}=\frac{15}{8}。

输入解题思路,AI测评打分。不知道怎么写?

首页