#include<stdio.h>
 
#define BAFF 200000
int main(){
  int N,K,A[BAFF+15];
  
  scanf("%d",&N);
  scanf("%d",&K);
  for(int i=1;i<=N;i++)scanf("%d",&A[i]);
  
  int li[BAFF+15]={0};
  double ldtc;
  for(int k=0;k<K;k++){
    for(int i=1;i<=N;i++){
      ldtc=A[i]+0.5;
      li[i]++;
      for(int j=1;j<=ldtc;j++){
       if(i-j>=1)li[i-j]++;
       if(i+j<=BAFF)li[i+j]++;
     }
    }
    for(int n=1;n<=N;n++){
      A[n]=li[n];
      li[n]=0;
    }
  }
  
  for(int n=1;n<=N;n++){
   printf("%d",A[n]); 
  }
 return 0;
}