Given three numbers a,b,Pa, b, Pa,b,P, compute the value of a×ba \times ba×b modulo PPP.
One line containing three integers a,b,Pa, b, Pa,b,P.
Output one integer — the answer.
3 5 10
5
For 100%100\%100% of the test cases, 0≤a,b≤10180 \le a, b \le 10^{18}0≤a,b≤1018 and 1≤P≤10181 \le P \le 10^{18}1≤P≤1018.
注册一个 HiJudge 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 HiJudge 通用账户