#include<stdio.h>
#include<string.h>
//#include<stdlib.h>
#include<math.h>

int main(void){
  int N,K;
  int i,j,m,n;
  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 - A[j] + 1;m <= j + A[j] + 1;m++){
        if(m <= 0 || m - 1 >= N){
          continue;
        }
        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;
}