#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P  = pair<int, int>;
int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int& i : a) cin >> i;
    for (int t = 0; t < min(50, k); ++t) {
        vector<int> b(n, 0);
        for (int i = 0; i < n; ++i) {
            ++b[max(0, i - a[i])];
            if (i + a[i] + 1 < n) --b[i + a[i] + 1];
        }
        for (int i = 1; i < n; ++i) b[i] += b[i - 1];
        a = b;
    }
    for (int i : a) cout << i << " ";
    return 0;
}
