int pow(int a,int b,int m){
cout<<a<<b<<endl;
if(b == 1)
return a % m;
if(b % 2 == 0){
int t = pow(a,b/2,m);
return (1ll * t * t % m);
}
else{
int t = pow(a,(b-1)/2,m);
t = (1ll * t * t % m);
return (1ll * a * t % m);
}
}
JUST Works