#include #include using namespace std; using namespace atcoder; using mint = modint998244353; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } template ostream& operator << (ostream& os, const vector& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector a(n); cin >> a; vector tmp(1, 1), coef(n), c(n); for(int i = 0; i < n; i += 2) coef[i] = 1; int ex = k / 2 + 1; 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; } /*vector d = {1, 0, 0}; for(int i = 0; i < k; i++){ for(int j = 1; j < n; j++){ if (j % 2 == 1) d[j] = d[j - 1] - d[j]; else d[j] = d[j - 1] + d[j]; } cerr << d << '\n'; } cerr << "\n";*/ for(int i = 0; i < n; i++) c[i] = a[i]; 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' : ' '); } }