#include <stdio.h>

int main(void){
    int N,K;
    int lamp_power[200000];
    int lamped_num[200000]={0};
    int i,j,k;
    int d;
    int min,max;
    float minf,maxf;
    scanf("%d %d",&N,&K);
    //入力
    for(i=0;i<N;i++){
        //printf("i = %d",i);
        scanf("%d",&lamp_power[i]);
    }/*
    for(i=0;i<N;i++){
        printf("%d : %d",i,lamp_power[i]);
    }*/
    //printf("\n");
    for(k=0;k<K;k++){
        //@lamped_numの初期化
        for(i=0;i<N;i++){
            lamped_num[i] = 0;
        }
        for(i=0;i<N;i++){
            d = lamp_power[i];
            minf = ((float)(i+1-d))-0.5;
            maxf = ((float)(i+1+d))+0.5;
            min = (int) minf;
            max = (int) maxf;
            /*
            if(maxf >0){
                max = ((int)maxf) -1;
            }
            if(min >0){
                min = ((int)minf) -1;
            }*/
            //printf("min = %d, max = %d   ",min,max);
            for(j=min;j<max;j++){
                    lamped_num[j]++;
                    //printf("j : %d\n",j+1);
                
            }
        }
        //lamp_powerにlamped_numをコピー
        for(i=0;i<N;i++){
            lamp_power[i] = lamped_num[i];
        }
    }
    //printf("処理終了\n");
    //出力
    for(i=0;i<N;i++){
        printf("%d ",lamp_power[i]);
    }
    return 0;
}