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

int main(void) {
  long long int n, k;
  scanf("%lld %lld", &n, &k);
  long long int light[k + 1][n];
  for (long long int i = 0; i < n; i++) {
    scanf(" %lld", &light[0][i]);
  }

  for (long long int i = 0; i < k; i++) {
    for (long long int j = 0; j < n; j++) {
      light[i + 1][j] = 0;
    }

    for (long long int j = 0; j < n; j++) {
      for (long long int x = 0; x <= light[i][j]; x++) {
        if (x) {
          if (j - x >= 0) {
            light[i + 1][j - x]++;
          }
          if (j + x <= n - 1) {
            light[i + 1][j + x]++;
          }
        } else {
          light[i + 1][j]++;
        }
      }
    }
  }

  for (long long int i = 0; i < n; i++) {
    printf("%lld", light[k][i]);
    if (i < n - 1) {
      printf(" ");
    } else {
      printf("\n");
    }
  }

  return 0;
}
