#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b; return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b; return true;
    }
    return false;
}
template<int MOD> struct Fp {
    ll val;
    constexpr Fp(ll v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        ll a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            ll t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, ll n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
constexpr ll MOD = 1e9 + 7;
using mint = Fp<MOD>;

#define pb push_back
#define mp make_pair
#define mt make_tuple

void debug(vector<int> arr) {
    REP(i, SIZE(arr)) {
        if (i != 0) cout << " ";
        cout << arr[i];
        //if (i == 80) {
        //    cout << "...";
        //    break;
        //}
    }
    cout << endl;
}

template <class Abel> struct BIT {
    vector<Abel> dat[2];
    Abel UNITY_SUM = 0;                     // to be set

    /* [1, n] */
    BIT(int n) { init(n); }
    void init(int n) {
        REP(iter, 2) dat[iter].assign(n + 1, UNITY_SUM);
    }

    /* a, b are 1-indexed, [a, b) */
    inline void sub_add(int p, int a, Abel x) {
        for (int i = a; i < (int)dat[p].size(); i += i & -i)
            dat[p][i] = dat[p][i] + x;
    }
    inline void add(int a, int b, Abel x) {
        sub_add(0, a, x * -(a - 1)); sub_add(1, a, x); sub_add(0, b, x * (b - 1)); sub_add(1, b, x * (-1));
    }

    /* a is 1-indexed, [a, b) */
    inline Abel sub_sum(int p, int a) {
        Abel res = UNITY_SUM;
        for (int i = a; i > 0; i -= i & -i) res = res + dat[p][i];
        return res;
    }
    inline Abel sum(int a, int b) {
        return sub_sum(0, b - 1) + sub_sum(1, b - 1) * (b - 1) - sub_sum(0, a - 1) - sub_sum(1, a - 1) * (a - 1);
    }

    /* debug */
    void print() {
        for (int i = 1; i < (int)dat[0].size(); ++i) cout << sum(i, i + 1) << ",";
        cout << endl;
    }
};


vector<int> solve_slow(int N, int K, vector<int> As) {
    debug(As);
    REP(k, K) {
        vector<int> nxt(N);
        REP(i, N) {
            auto a = As[i];
            FOR(j, max(0, i - a), min(N, i + a + 1)) {
                nxt[j]++;
            }
        }
        As = nxt;
        cout << "k " << k << ": ";
        debug(As);
    }
    return As;
}

vector<int> solve_fast(int N, int K, vector<int> As) {
    //debug(As);

    BIT<int> bit1(N);
    REP(i, N) {
        bit1.add(i + 1, i + 2, As[i]);
    }

    BIT<int> bit2(N);

    bool flag = true;
    BIT<int>* bit = &bit1;
    BIT<int>* nxt = &bit2;

    REP(k, K) {
        if (!flag) {
            bit = &bit2;
            nxt = &bit1;
        }
        else {
            bit = &bit1;
            nxt = &bit2;
        }
        nxt->init(N);

        REP(i, N) {
            auto a = bit->sum(i + 1, i + 2);
            auto begin = max(0, i - a);
            auto end = min(N, i + a + 1);
            nxt->add(begin + 1, end + 1, 1);
        }

        //// debug
        //cout << "k " << k << ": ";
        //vector<int> tmp(N);
        //REP(i, N) {
        //    tmp[i] = nxt->sum(i + 1, i + 2);
        //}
        //debug(tmp);

        flag = !flag;
        if (k == 45) break;
    }

    vector<int> ret(N);
    REP(i, N) {
        ret[i] = nxt->sum(i + 1, i + 2);
    }
    return ret;
}

int main(void)
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int N, K;
    cin >> N >> K;
    vector<int> As(N);
    REP(n, N) cin >> As[n];

    auto ans_fast = solve_fast(N, K, As);
    debug(ans_fast);

    //auto ans_slow = solve_slow(N, K, As);
    //debug(ans_slow);


    return 0;
}


Measured memory_bytes: 8748