[BOJ 11819] The Shortest does not Mean the Simplest

View as PDF

Submit solution

Points: 2
Time limit: 2.0s
Memory limit: 256M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Your are given integer numbers A, B and C. Output the remainder of division AB (B-th power of A) by C .

입력 형식

The only line of the input file contains three integers: A, B, C (1 ≤ A,B,C ≤ 1018). Numbers are separated by spaces.

출력 형식

Output must contain only one non-negative integer less than C ? the answer to the problem.

예제 입력

3 4 5

예제 출력

1

Comments

There are no comments at the moment.