#include<stdio.h>
#define NUM 200001

int main(void) {
  int N, K, i, j, k;
  int A[NUM], countA[NUM];
  
  scanf("%d %d", &N, &K);
  for(i = 0;i < N;i++)  scanf("%d", &A[i]);
  
  int bef, aft;
  
  for(k = 0;k < K;k++){
    for(i = 0; i < N; i++){
      bef = i - A[i];
      aft = i + A[i];
      for(j = bef; j <= aft; j++){
        if(j < 0) continue;
        if(j > N) break;
        countA[j]++;
      }
    }
    for(j = 0; j < N; j++){
      A[j] = countA[j];
      countA[j] = 0;
    }
  }
  
  for(i = 0; i < N; i++)  printf("%d ",A[i]);
  printf("\n");
      
  
  return 0;
}