#include<bits/stdc++.h>
using namespace std;
int N,K;
int main(){
    cin>>N>>K;
    int A[2][N+1];
    for(int i=0;i<N;i++)cin>>A[0][i];
    for(int i=0;i<=N;i++)A[1][i]=0LL;
    for(int k=0;k<min(K,100);k++){
        for(int i=0;i<N;i++){
            A[(k+1)%2][max(0,i-A[k%2][i])]++;
            A[(k+1)%2][min(N,i+A[k%2][i]+1)]--;
        }
        for(int i=1;i<=N;i++)A[(k+1)%2][i]+=A[(k+1)%2][i-1],A[k%2][i-1]=0;
    }
    for(int i=0;i<N;i++)cout<<A[(K<100)?K%2:0][i]<<" \n"[i+1==N];
    return 0;
}