#include <bits/stdc++.h>

using namespace std;

template<typename S, typename T>
ostream& operator<<(ostream& out, const pair<S, T> p) {
    out << "(" << p.first << "," << p.second << ")";
    return out;
}

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
    for (auto a: v)
        out << a << " ";
    return out;
}

template<typename T>
ostream& operator<<(ostream& out, const set<T>& S) {
    for (auto a: S)
        cout << a << " ";
    return out;
}

template<typename T>
ostream& operator<<(ostream& out, const multiset<T>& S) {
    for (auto a: S)
        cout << a << " ";
    return out;
}

template<typename S, typename T>
ostream& operator<<(ostream& out, const map<S, T>& M) {
    for (auto m: M)
        cout << "(" << m.first << "->" << m.second << ") ";
    return out;
}

template<typename S, typename T>
pair<S, T> operator+(pair<S, T> a, pair<S, T> b) {
    return make_pair(a.first + b.first, a.second + b.second);
}

template<typename S, typename T>
pair<S, T> operator-(pair<S, T> a, pair<S, T> b) {
    return make_pair(a.first - b.first, a.second - b.second);
}

template<typename T>
struct SegmentTree {
    int n;
    vector<T> addv;

    void init(int n) {
        this->n = n;
        addv.assign(2 * n - 1, 0);
    }

    template<typename ParameterType>
    void buildup(vector<ParameterType>& A) {
        n = A.size();
        init(n);
        for (int i = 0; i < n; i++)
            addv[i + n - 1] = A[i];
    }

    void add_value(int x, int y, T val) {
        x += n - 1;
        y += n - 1;
        while (x <= y) {
            if (x % 2 == 0) {
                addv[x++] += val;
            } else if (y % 2) {
                addv[y--] += val;
            } else {
                x = (x - 1) / 2;
                y = (y - 1) / 2;
            }
        }
    }

    void pushdown() {
        for (int i = 0; i < n - 1; i++) {
            addv[2*i+1] += addv[i];
            addv[2*i+2] += addv[i];
            addv[i] = 0;
        }
    }

    T query_value_after_pushdown(int x) {
        x += n - 1;
        return addv[x];
    }

    T query_value(int x) {
        x += n - 1;
        T ans = addv[x];
        while (x) {
            x = (x - 1) / 2;
            ans += addv[x];
        }
        return ans;
    }

    vector<T> unwind() {
        vector<T> A(n);
        for (int i = 0; i < n; i++)
            A[i] = query_value(i);
        return A;
    }
};

SegmentTree<long long> segment;

void solve() {
    int n, m;
    vector<long long> A;
    cin >> n >> m;
    A.resize(n);
    for (int i = 0; i < n; i++)
        cin >> A[i];
    while (m--) {
        int min_val = *min_element(A.begin(), A.end());
        if (min_val == n)
            break;
        segment.init(n);
        for (int i = 0; i < n; i++) {
            int l = max(0ll, i - A[i]);
            int r = min(0ll + n - 1, i + A[i]);
            segment.add_value(l, r, 1);
        }
        segment.pushdown();
        for (int i = 0; i < n; i++)
            A[i] = segment.query_value_after_pushdown(i);
    }
    cout << A << endl;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    solve();
    return 0;
}


Measured memory_bytes: 7948