#P1226. Modular Exponentiation
Modular Exponentiation
Modular Exponentiation
Given three integers a
, b
, and p
, compute the value of \(a^b \bmod p\).
inputFormat
The input consists of three integers a
, b
, and p
separated by spaces.
outputFormat
Output a single integer representing \(a^b \bmod p\).
sample
2 10 1000
24