#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(k=0;k<K;k++){
        for(i=0;i<N;i++){
            lamped_num[i] = 0;
        }
        for(i=0;i<N;i++){
            d = lamp_power[i];
            min = i+1-d-0.5;
            max = i+1+d+0.5;
            for(j=min;j<max;j++){
                    lamped_num[j]++;
            }
        }
        for(i=0;i<N;i++){
            lamp_power[i] = lamped_num[i];
        }
    }
    for(i=0;i<N;i++){
        printf("%d ",lamp_power[i]);
    }
    return 0;
}