#include <stdio.h>

int main()
{
  int n,k;
  scanf("%d%d",&n,&k);
  int a[n];
  int i;
  i = 0;
  while (i < n)
  {
    scanf("%d",&a[i]);
    i++;
  }
  i = 0;
  /*
  while (i < n)
  {
    printf("%d",a[i]);
    i++;
  }
  */
  int j;
  int m;
  int cnt[n];
  int index;
  index = 0;
  i = 0;
  while (i < n)
  {
    cnt[i] = 0;
    i++;
  }
  i = 0;
  while (i < k)
  {
    j = 0;
    while (j < n)
    {
      m = j-a[j];
      while (m <= j+a[j])
      {
        //printf("m:%d\n",m);
        if (m < 0 || m >= n)
        {
          m++;
          continue;
        }
        else
        {
          //printf("a[m]:%d\n",a[m]);
          cnt[m]++;
        }
        m++;
      }
      j++;
    }
    index = 0;
    while (index < n)
    {
      a[index] = cnt[index];
      cnt[index] = 0;
      index++;
    }
    i++;
  }
  i = 0;
  while (i < n)
  {
    printf("%d ",a[i]);
    i++;
  }
}