//#include //using namespace atcoder; #include using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0;i<(n);i++) using C = complex; double pi = acos(-1.0); void FFT(vector& A, bool inv) { int N=A.size(); for(int i=0,j=0; j>1; k>(i^=k); k>>=1); } for(int i=1; i CONV(const vector& A,const vector& B) { int Z=1; while(Z Ax(Z),Bx(Z); rep(i,Z) Ax[i]=Bx[i]=0; rep(i,A.size()) Ax[i]=A[i]; rep(i,B.size()) Bx[i]=B[i]; FFT(Ax,false); FFT(Bx,false); rep(i,Z) Ax[i]*=Bx[i]; FFT(Ax,true); return move(Ax); } int main(){ int N,Q; cin>>N>>Q; vector A(N); rep(i,N){ int a; cin>>a; A[i]=C((double)a,0.); } vector R(N+1); rep(i,Q){ int r; cin>>r; R[N-r]+=C(1.,0.); } vector G = CONV(A,R); vector ans(N); rep(i,G.size()) ans[i%N] += LL(G[i].real()+0.5); rep(i,N){ if(i) cout<<" "; cout<