#include <stdio.h>

int main(void) {

  long n,k;
  scanf("%ld %ld", &n, &k);
  long a[n];
  for (long i = 0; i < n; i++) {
    scanf("%ld", &a[i]);
  }
  long imos[n];
  long cur;
  int flag;
  for (long i = 0; i < k; i++) {
    for (long j = 0; j < n; j++) {
      imos[j] = 0;
    }
    for (long j = 0; j < n; j++) {
      cur = j-a[j];
      if (cur < 0) {
        cur = 0;
      }
      imos[cur]++;
      cur = j+a[j]+1;
      if (cur <= n-1) {
        imos[cur]--;
      }
    }
    a[0] = imos[0];
    for (long j = 1; j < n; j++) {
      a[j] = a[j-1]+imos[j];
    }
    flag = 0;
    for (long j = 0; j < n; j++) {
      if (a[j] != n) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      break;
    }
  }
  for (long i = 0; i < n-1; i++) {
    printf("%ld ", a[i]);
  }
  printf("%ld\n", a[n-1]);

  return 0;
}