#include <stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
int t,a,b,c,i;
__int64 x;
scanf("%d",&t);
while(t--){
scanf("%d%d%d",&a,&b,&c);
a=a%c;
x=1;
for(i=1;i<=b;i++){
x*=a;
x%=c;
}
printf("%I64d\n",x);
}
return 0;
}
hdu1420 Prepared for New Acmer
最新推荐文章于 2022-02-25 21:57:21 发布