Power Mod
Xem dạng PDF
Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch, TEXT
Modular Exponentiation
Given three integers x, n, and k, calculate the value of:
x^n % k
Input
A single line contains three integers x, n, and k.
0 < k <= 10^9
n >= 0
x >= 0
Output
Output the value of x^n % k.
Example
Input
2 8 5
Output
1
Bình luận