#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");
    int flaga=0,flagc=0;
    for(k=0;k<K;k++){
        //@lamped_numの初期化
        for(i=0;i<N;i++){
            lamped_num[i] = 0;
        }
        if(flaga ==1){
            for(i=0;i<N;i++){
                lamp_power[i] = lamp_power[i] + 5;
            }
            continue;
        }
        flagc=0;
        if(flaga==0){
            for(i=0;i<N;i++){
                if(lamp_power[i] < N-1)    flagc==1;
            }
        }
        if(flagc ==1){
            flaga=1;
        }
        for(i=0;i<N;i++){
            d = lamp_power[i];
            min = i+1-d-0.5;
            max = i+1+d+0.5;
            /*
            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   \n",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;
}