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

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

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