PowMod

TimeLimit:1500MS  MemoryLimit:262144KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
Declare:
$k=\sum_{i=1}^{m} \varphi (i*n)\ mod\ 1000000007$

$n$ is a square-free number.

$\varphi $ is the Euler's totient function.

find:
$ans=k^{k^{k^{k^{...^k}}}}\ mod \ p$

There are infinite number of $k$
Input
Multiple test cases(test cases $\leq 100$), one line per case.

Each line contains three integers, $n, m$ and $p$.

$1 \leq n, m, p \leq 10^{7}$
Output
For each case, output a single line with one integer, ans.
SampleInput
1 2 6
1 100 9
SampleOutput
4
7
Submit
题目统计信息详细
总AC数2
通过人数2
尝试人数3
总提交量4
AC率50.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: