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

int cmp(const void * n1, const void * n2){
  if(*(double *) n1 > *(double *) n2){
    return 1;
  }else if (*(double *) n1 < *(double *) n2){
    return -1;
  }else{
    return 0; 
  }
}

int main(){
    int n,k;
    scanf("%d %d", &n, &k);
    int arr[n];
    double t1[n], t2[n];
    for(int i=0;i<n;i++)scanf("%d",&arr[i]);
  
    for(int i=0;i<k;i++){
      for(int j=0;j<n;j++){
        t1[j] = j - arr[j] - 0.5;
        t2[j] = j + arr[j] + 0.5;
      }
      qsort(t1, sizeof(t1)/sizeof(t1[0]), sizeof(double), cmp);
      qsort(t2, sizeof(t2)/sizeof(t2[0]), sizeof(double), cmp);

      int tmp = 0;
      int k = 0;
      int h = 0;
      for(int j=0;j<n;j++){
        int tmpk = 0;
        int tmph = 0;
        while (k < n && t1[k] <= j) {k++;tmpk++;}
        while (h < n && t2[h] < j) {h++;tmph++;}
        tmp = tmp + tmpk - tmph;
        arr[j] = tmp;
      }
    }
    for(int l=0;l<n;l++)printf("%d ",arr[l]);
    return 0;
}