#include #include using namespace std; using namespace atcoder; using mint = modint998244353; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector tmp(1, 1), coef(n), c(n); for(int i = 0; i < n; i++){ int v; cin >> v; c[i] = v; } for(int i = 0; i < n; i += 2) coef[i] = 1; int ex = (k + 1) / 2; while(ex != 0){ if(ex & 1){ tmp = convolution(tmp, coef); while(tmp.size() > n) tmp.pop_back(); } coef = convolution(coef, coef); while(coef.size() > n) coef.pop_back(); ex /= 2; } if(k % 2 == 1){ for(int i = 1; i < n; i += 2){ c[i] = -c[i]; tmp[i] = tmp[i - 1]; } } auto ans = convolution(c, tmp); while(ans.size() > n) ans.pop_back(); for(int i = 0; i < n; i++){ cout << ans[i].val() << (i + 1 == n ? '\n' : ' '); } }