fastmod即是唯一真神
int Mod;
struct fastmod{} mod;
unsigned long long iMod;
ll operator %(ll x,fastmod) {
x-=ll((__int128_t)x*iMod>>64)*Mod+Mod;
return x+(Mod&(x>>63));
}
//......
Mod=read();
iMod=(unsigned long long)-1/Mod;
int Mod;
struct fastmod{} mod;
unsigned long long iMod;
ll operator %(ll x,fastmod) {
x-=ll((__int128_t)x*iMod>>64)*Mod+Mod;
return x+(Mod&(x>>63));
}
//......
Mod=read();
iMod=(unsigned long long)-1/Mod;