This documentation is automatically generated by online-judge-tools/verification-helper
// BEGIN CUT
ll modpow(ll x, ll y, ll m) {
ll a = 1, p = x;
while(y > 0) {
if(y%2 == 0) {p = (p*p) % m; y /= 2;}
else {a = (a*p) % m; y--;}
}
return a;
}
// END CUT
#line 1 "math/modpow.cpp"
// BEGIN CUT
ll modpow(ll x, ll y, ll m) {
ll a = 1, p = x;
while(y > 0) {
if(y%2 == 0) {p = (p*p) % m; y /= 2;}
else {a = (a*p) % m; y--;}
}
return a;
}
// END CUT