z-polinom
给你3个数 A, N, M. 计算下面这表达式的结果,结果模M(就是除以M的余数): A^0 + A^1 + ... + A^N.(翻译者:陈鸣--Spencer Velicue)
InputT标准输入的第一行包含这3个数 A, N 和 M (1 <= A, N, M <= 10^9).
Output在标准输出的第一行输出结果
Input:
Output:
Explanation:
2^0 + 2^1 + 2^2 + 2^3 = 1 + 2 + 4 + 8 = 15. 15 mod 10 = 5.
2 3 10Output:
5Explanation:
2^0 + 2^1 + 2^2 + 2^3 = 1 + 2 + 4 + 8 = 15. 15 mod 10 = 5.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.