#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; bool rcmp(int a, int b) { return a>b; } typedef long long LL; class mypcmp { public: bool operator()(const int& a, const int& b) { return a>=1; } return r; } void fft(int *p, int n, char revert) { if ((MOD-1)%n) assert(0); int rt = expit(GGG, (MOD-1)/n); LL x, y; if (revert) { rt = expit(rt, MOD-2); } int b, i, j, l, t; LL w, ww, v, u, vv; for (i=1, j=0; i>1; for (; j&b; b>>=1) j^=b; j^=b; if (i=MOD) vv-=MOD; p[i+j]=vv; vv=u-v; if (vv<0) vv+=MOD; p[i+j+l/2]=vv; ww*=w; ww%=MOD; } } } if (revert) { x = expit(n, MOD-2); for (i=0; i0&&pbuf1[i]==0) i--; return i; } int ff[300][601*300]; int fc[300]; int as[200004], bs[200004]; int p1[800], p2[800]; int ft[400], ift[400]; int main() { int n, i, m, s, e, k, c, d, j, a, b, mc; LL v; ft[0]=ift[0]=1; for (i=1; i<=300; i++) { v=ft[i-1]; v*=i; v%=MOD; ft[i]=v; ift[i]=expit(v, MOD-2); } scanf("%d %d", &n, &m); for (i=0; i1) { s=0; e=k-1; while(s