//vanitas vanitatum et omnia #include #define fi first #define se second #define eb emplace_back #define mp make_pair using namespace std; typedef long double ld; typedef long long ll; typedef unsigned long long ull; typedef __int128 i128; template T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);} template T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);} template bool chmax(T &a,const S b) {return (a bool chmin(T &a,const S b) {return (a>b?a=b,1:0);} int popcnt(int x) {return __builtin_popcount(x);} int popcnt(ll x) {return __builtin_popcountll(x);} int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));} int topbit(ll x) {return (x==0?-1:63-__builtin_clzll(x));} int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));} int lowbit(ll x) {return (x==0?-1:__builtin_ctzll(x));} #define int long long #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define per(i,a,b) for(int i=(a);i>=(b);i--) typedef pair pii; typedef vector vi; typedef vector vp; typedef tuple tiii; int read() { int x=0,w=1; char c=getchar(); while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();} while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();} return x*w; } const int N=2e5+5; int T,n,m,a[N],b[N],fac[N],c[N],ifac[N],mod; int ksm(int x,int y,int r=1) { for(;y;y>>=1,x=x*x%mod) if(y&1) r=r*x%mod; return r; } void exgcd(int a,int b,int &x,int &y) { if(b==0) {x=1, y=0; return;} exgcd(b,a%b,x,y); int d=x; x=y, y=d-a/b*y; } int inv(int x) { int a,b; exgcd(x,mod,a,b); return (a%mod+mod)%mod; } void pre() { fac[0]=1; rep(i,1,n) { int x=i; c[i]=c[i-1]; while(x%2==0) x/=2, c[i]++; fac[i]=fac[i-1]*x%mod; //cout<=m) return 0; else { int p=(1<