/** author: shobonvip created: 2024.11.16 19:57:51 **/ #include using namespace std; //* ATCODER #include using namespace atcoder; typedef modint998244353 mint; //*/ /* BOOST MULTIPRECISION #include using namespace boost::multiprecision; //*/ typedef long long ll; #define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++) #define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--) #define all(v) v.begin(), v.end() template bool chmin(T &a, const T &b) { if (a <= b) return false; a = b; return true; } template bool chmax(T &a, const T &b) { if (a >= b) return false; a = b; return true; } template T max(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmax(ret, a[i]); return ret; } template T min(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmin(ret, a[i]); return ret; } template T sum(vector &a){ T ret = 0; for (int i=0; i<(int)a.size(); i++) ret += a[i]; return ret; } //defmodfact const int COMinitMAX = 998244; mint fact[COMinitMAX+1], factinv[COMinitMAX+1]; void modfact(){ fact[0] = 1; for (int i=1; i<=COMinitMAX; i++){ fact[i] = fact[i-1] * i; } factinv[COMinitMAX] = fact[COMinitMAX].inv(); for (int i=COMinitMAX-1; i>=0; i--){ factinv[i] = factinv[i+1] * (i+1); } } mint binom(int a, int b){ if (a> n >> k; vector a(n); rep(i,0,n) cin >> a[i]; vector f(n); rep(i,0,n) { if (i % 2 == 0) { f[i] = a[i]; }else{ f[i] = -a[i]; } } segtree kukan(n*2); rep(i,0,n) { kukan.set(i, (k+1)/2 + i); } vector g(n); rep(i,0,n) { if (i % 2 == 0) { g[i] = kukan.prod(0, i/2) * factinv[i/2]; }else if(k % 2 == 1){ g[i] = kukan.prod(0, i/2) * factinv[i/2]; } //cout << g[i].val() << ' '; } vector h = convolution(f, g); rep(i,0,n) { cout << h[i].val() << ' '; } cout << '\n'; }