Last K Digits of a Power
Print the last K digits of AB, padded with leading zeros to exactly K digits.
Input: one line with three integers A, B, K.
Output: the last K digits (zero-padded).
Constraints:
- 1 ≤ A ≤ 109
- 1 ≤ B ≤ 1018
- 1 ≤ K ≤ 9
Sample Tests
Input 1
2 10 3
Output 1
024
Input 2
5 3 5
Output 2
00125
Discussion (opens after you solve — no spoilers before)
No comments yet.