#include<stdio.h>


int main(void){
  int N,K;
  int i,j,m,n,start,end,index;
  scanf("%d %d",&N,&K);
  int A[N];
  int B[N];
  for(i = 0;i < N;i++){
    scanf("%d",&A[i]);
    B[i] = 0;
  }
  for(i = 0;i < K ;i++){
    for(j = 0;j < N;j++){
      for(m = j + 1 - A[j];m <= j + 1 + A[j];m++){
        if(m >= 1 || m <= N){
          B[m - 1]++;
        }
      }
    }
    for(n = 0;n < N;n++){
      A[n] = B[n];
      B[n] = 0;
    }
  }

  for(i = 0;i < N;i++){
    printf("%d ",A[i]);
  }
  printf("\n");
  return 0;
}