#include<stdio.h>
#include<stdlib.h>

void main(){
  long N,K;
  long n;
  long k,j;
  long *A,*AA;
  int dm;
  dm=scanf("%ld %ld",&N,&K);
  A = (long*)malloc(sizeof(long)*N);
  AA = (long*)malloc(sizeof(long)*N);
  for(n=0;n<N;n++){
  	dm=scanf("%ld", A + n);
  }

  for(k=0;k<K;k++){
    for(n=0;n<N;n++){
      AA[n]++;
      if(A[n] > 0){
        for(j=0;j<A[n];j++){
          if(N > n + j + 1 && AA[n + j + 1] < N){ 
            AA[n + j + 1]++;
          }
          if(n >= j + 1 && AA[n - j - 1] < N){
            AA[n - j - 1]++;
          }
      }
    }
  }
    for(j=0;j<N;j++){
      A[j] = AA[j];
      AA[j] = 0;
    }
  }
  for(j=0;j<N;j++){
  	printf("%d ", A[j]);
  }
  printf("\n");
}