/*
* welcome to my code!
* ------------------------------------------
* author : lynmisakura(twitter : @andoreiji11)
*/

#include<bits/stdc++.h>
using namespace std;

using ll = long long;

// macro templates

#define rrep(i,n) for(int i = n - 1;i >= 0;i--)
#define rep(i,n) for(int i = 0;i < n;i++)
#define dv(TYPE,VAL) TYPE VAL;cin >> VAL;
#define vi(TYPE,NAME,SIZE,INIT) vector<TYPE> NAME(SIZE,(INIT))
#define vin(TYPE,NAME,SIZE) vector<TYPE> NAME(SIZE);rep(i,SIZE)cin >> NAME[i]
#define vout(ARRAY) for(auto i : ARRAY)cout << i << ' ';cout << '\n'
#define vvi(TYPE,NAME,LOW,COL,INIT) vector<vector<TYPE>> NAME(LOW,vector<TYPE>(COL,INIT))
#define vpi(T1,T2,NAME,SIZE,I1,I2) vector<pair<T1,T2>> NAME(SIZE,make_pair(I1,I2))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define dup(x,y) (x + y - 1)/y
#define sz(v) (int64_t)v.size()
#define CUM(arr,cum) vector<ll> cum(sz(a)+1,0); rep(i,sz(a)) cum[i+1] = cum[i] + 1
#define PY(COND) if(COND){cout << "YES" << '\n';return;}
#define PN(COND) if(COND){cout << "NO" << '\n';return;}
#define PYN(COND) cout << ((COND) ? "YES" : "NO") << '\n';
#define Py(COND) if(COND){cout << "Yes" << '\n';return;}
#define Pn(COND) if(COND){cout << "No" << '\n';return;}
#define Pyn(COND) cout << ((COND) ? "Yes" : "No") << '\n';return

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pi acos(-1)
#define fi first
#define se second
#define pq priority_queue

#define MULTITEST; int t;cin >> t;rep(_,t)main2();
#define IOB; cin.tie(0);ios::sync_with_stdio(false);

template<class T> bool chmin(T& a,T b){if(a>b){a=b;return 1;}else return false;}
template<class T> bool chmax(T& a,T b){if(a<b){a=b;return 1;}else return false;}

// templates end

void main2(){

}
template<class TYPE> struct SegmentTree{
   TYPE minvalue;
   static const int MAX_N = 100010; // edit here!

   int size;
   TYPE dat[2 * MAX_N - 1];

   SegmentTree(int N,TYPE minvalue):minvalue(minvalue){
        size = 1;
        while(size < N){ size *= 2; }
        for(int i = 0;i < 2 * size - 1;i++) dat[i] = minvalue;

   }
    TYPE get_func(TYPE a,TYPE b){ // edit here!
       return a + b;
    }

    void update(int k,TYPE a){ // edit here!
        k += size - 1;
        dat[k] += a;  // edit here !;
        while(k > 0){
            k = (k - 1) / 2;
            dat[k] = get_func(dat[2 * k + 1],dat[2 * k + 2]);
        }
    }

    // [a,b) , call as query(a,b,0,0,size)
    TYPE query(int a,int b,int k,int l,int r){
        if(r <= a || b <= l){
            return minvalue;
        }
        if(a <= l && r <= b){
            return dat[k];
        }
        else{
            TYPE vl = query(a,b,k * 2 + 1,l,(l + r)/2);
            TYPE vr = query(a,b,k * 2 + 2,(l + r)/2,r);
            return get_func(vl,vr);
        }
    }

    void print(){
       for(int i = 0;i < size;i++) cout << dat[i + size - 1] << ' ';
       cout << '\n';
   }
};

int main(void){
    IOB;
    //MULTITEST

    int64_t n,k;cin >> n >> k;
    vin(int64_t ,a,n);

    rep(i,k){
        vector<int64_t> c(n+1,0);
        rep(j,n){
            int64_t l = max((int64_t )0,j - a[j]);
            int64_t r = min(n,j + 1 + a[j]);
            c[l]++;
            c[r]--;
        }
        rep(j,n)c[j+1] += c[j];
        rep(j,n)a[j] = c[j];
        bool f = true;
        rep(j,n)if(a[j] != n){f =false; break;}
        if(f){
            rep(j,n)cout << n << (j < n - 1 ? ' ' : '\n');
            return 0;
        }
    }
    rep(i,n)cout << a[i] << (i < n - 1 ? ' ': '\n');
}


Measured memory_bytes: 6364