inline long long mul(long long x,long long y,long long MOD) { x=x%MOD,y=y%MOD; return ((x*y-(LL)(((long double)x*y+0.5)/MOD)*MOD)%MOD+MOD)%MOD; }