#include #include using namespace std; using namespace atcoder; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; #define REP(i,n) for(int i=0;i> n >> q; VI a(n); REP(i,n) cin >> a[i]; VI p(n,0); int r; REP(i,q){ cin >> r; p[r]++; } reverse(ALL(a)); copy(ALL(p),back_inserter(p)); VI ans=convolution_ll(a,p); for(int i=n*2-1;i>=n;i--) cout << ans[i] << " "; cout << endl; return 0; }