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

typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    int n,k; cin>>n>>k;
    vector<int>a(n);
    rep(i,n)cin>>a[i];
    
    rep(j,k){
        vector<int>b(n+1);
    rep(i,n){
        int l,r;
        l = max(0,i-a[i]);
        r = min(n,i+ a[i]);
        ++b[l]; --b[r+1];
    }
    rep(i,n+1)b[i+1]+=b[i];
    b.pop_back();
    if(a == b)break;
    else a = b;
    }
    
    rep(i, n){
        cout<<a[i];
        if(i != n-1)cout<<" ";
        else cout<<endl;
    }

	return 0;
}