#define rep(x,y)for(int x=0;x<y;x++)
n,k,a[200009];main(){
 scanf("%d%d",&n,&k);
 if(k>=42||k>=n){rep(i,n)printf("%d ",n);return 0;}
 rep(i,n)scanf("%d",a+i);
 while(k--){
  int b[200009]={0},s=0;
  rep(i,n){b[(i-a[i]>0?i-a[i]:0)]++;b[(n-1>i+a[i]?i+a[i]:n-1)+1]--;}
  rep(i,n){s+=b[i];a[i]=s;}
 }
 rep(i,n)printf("%d ",a[i]);
}