Banner Home Page DIY Contests Problems Ranklist Status Statistics

还是幂取模

Time Limit : 6000/5000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 137   Accepted Submission(s) : 50

Font: Times New Roman | Verdana | Georgia

Font Size:

Problem Description

给定A,B,C,计算(A^(B^C))%100000007 (已知100000007是素数)

Input

输入数据有多组,每组数据一行,有3个数分别为A,B,C,1<=A,B,C<=1000000000

Output

输出(A^(B^C))%100000007的值

Sample Input

2 2 2
3 2 1

Sample Output

16
9

Author

lirh8121099

Statistic | Submit | Back