#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::cerr; using std::cin; using std::cout; using std::endl; //Copy from this line! typedef std::complex Complex; std::vector DFT(std::vector func, int size, int sign){ if(size==1) return func; std::vector result(size); std::vector func_a(size/2); std::vector func_b(size/2); for(int i=0;i InvDFT(std::vector func, int size){ std::vector result=DFT(func, size, -1); for(int i=0;i MultyplyFunction(std::vector func_f, std::vector func_g){ int min_size=func_f.size()+func_g.size()+1; int size=1; while(size func(size); for(int i=0;i>n; std::vector> a(n+1),b(n+1); for(int i=0;i<=n;i++){ int x; cin>>x; a[i]=std::complex(x); } for(int i=0;i<=n;i++){ int x; cin>>x; b[i]=std::complex(x); } std::vector> c=MultyplyFunction(a,b); int64_t result=0; const int64_t MOD=1000000007; for(int i=0;i<=n;i++){ result+=lround(c[i].real()); result%=MOD; } cout<