Submit | All submissions | Best solutions | Back to list |
EIUPH008 - Power Mod |
Given 3 integers x, n and k. Calculate the value of xn % k.
Input
THe only line contains three integers x, n, k (0< k <=109 , n>=0, x>=0).
Output
The value of the expression
Example
Input: 2 8 5 Output: 1