Prime Modular Inverse by kimiyuki

i;main(a,m,x){for(;~scanf("%d%d",&a,&m);printf("%d\n",x))for(x=1,i=m-2;i;i/=2)x=i&1?x*1ll*a%m:x,a=a*1ll*a%m;}

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

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page