Loading...
Loading...
Loading...
A report needs a to the power b, but the true value is gigantic. Print the remainder of a to the power b divided by m.
Example
Input
2 10 1000
Output
24
1024 leaves 24.
Try the problem first. Open one hint at a time.
Do not compute a ** b first. Python has a built-in for this.
pow(a, b, m) with three arguments.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor