问题3087--不一样的题目

3087: 不一样的题目

[命题人 : ]
时间限制 : 2.000 sec  内存限制 : 64 MB

题目描述

Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,C<=1000000000,1<=B<=10^1000000).

输入

There are multiply testcases. Each testcase, there is one line contains three integers A, B and C, separated by a single space.

输出

For each testcase, output an integer, denotes the result of A^B mod C.

样例输入 Copy

3 2 4
2 10 1000

样例输出 Copy

1
24

来源/分类

fzu