#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define popcount __builtin_popcount //#define double long double using namespace std; typedef long long int ll; typedef pair P; const int MOD=1e9+7; typedef complex Cd; const double PI=acos(-1.0); vector tmp; size_t sz; vector fft(vector a, bool inv=false){ size_t mask=sz-1; size_t p=0; for(size_t i=sz>>1; i>0; i>>=1){ auto& cur=((p&1) ? tmp : a); auto& nex=((p&1) ? a : tmp); //Cd e=polar((double)1.0, 2*PI*i*(inv ? -1.0 : 1.0)/sz); Cd w=1; for(size_t j=0; j convolution(vector a, vector b){ size_t m=a.size()+b.size()-1; sz=1; while(sz A(sz), B(sz); for(size_t i=0; i ans(m); for(size_t i=0; i convolution(vector a, vector b){ size_t m=a.size()+b.size()-1; sz=1; while(sz A(sz), B(sz), C(sz), D(sz); for(size_t i=0; i>15); for(size_t i=0; i>15); A=fft(A); B=fft(B); for(size_t i=0; i ans(sz); for(size_t i=0; i p, int k){ vector p0; p0.push_back(p[0]); vector ret(1, 1); int i=0; while((1< p1=convolution(ret, p0); p1.resize(1<>k>>n; vector p(100001, 0); p[0]=1; for(int i=0; i>x; p[x]=MOD-1; } cout<