#000045

z-stepen

小Z先生有一个数学问题。对于给定的数字 O, S, M 他得计算数字O的第S次方,结果再模M(就是除以M的余数).


帮助小Z先生计算结果


翻译者:陈鸣--Spencer Velicue


Input标准输入的第一行也是唯一的一行包含数字O, S, M. (0 < O <= 2000000000), (0 < S <= 20000000000). (0 < M <= 4000).

Output向标准输出输出一个数字是 (O^S) mod M.

Input:
2 10 10
Output:
4
Explanation:
(2 ^ 10) mod 10 = 1024 mod 10 = 4

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.