#include<stdio.h>

int max(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int min(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}

int main(void){
  int N,K;
  int i,j,m,n,start,end;
  
  scanf("%d %d",&N,&K);
  int MAX = N;
  int MIN = MAX;
  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++){
      start = max(1,j + 1 - A[j]);
      end = min(N,j + 1 + A[j]);
      for(m = start;m <= end;m++){
        
          B[m - 1]++;
        
      }
    }
    for(n = 0;n < N;n++){
      A[n] = B[n];
      if(MIN > B[n]){
        MIN = B[n];
      }
      B[n] = 0;
    }
    if(MIN == MAX){
      break;
    }else{
      MIN = MAX;
    }
  }

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