This documentation is automatically generated by online-judge-tools/verification-helper
template <class T>
T pow_ (T x, T n, T M){
uint64_t u = 1, xx = x;
while (n > 0){
if (n&1) u = u * xx % M;
xx = xx * xx % M;
n >>= 1;
}
return static_cast<T>(u);
};
#line 1 "math/pow.cpp"
template <class T>
T pow_ (T x, T n, T M){
uint64_t u = 1, xx = x;
while (n > 0){
if (n&1) u = u * xx % M;
xx = xx * xx % M;
n >>= 1;
}
return static_cast<T>(u);
};