Modular Exponentiation 2 by 51b

a;main(b,c,k){for(;~scanf("%d%d%d",&a,&b,&c);printf("%d\n",k))for(k=1;b%2?k=1ll*k*a%c:b;b/=2)a=1ll*a*a%c;}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page