#include<cstdio>
#include<cstring>
#define For(i,A,B) for(i=(A);i<=(B);++i)
const int N=200050;
int a[N],b[N],n;
inline bool check(){
	int i;
	For(i,1,n)if(a[i]<n)return 0;
	return 1;
}
int main(){
	int k,i,j;
	scanf("%d%d",&n,&k);
	For(i,1,n)scanf("%d",a+i);
	For(j,1,k)if(!check()){
		memset(b,0,sizeof(b));
		For(i,1,n){++b[i>a[i]?i-a[i]:1];if(i+a[i]<n)--b[i+a[i]+1];}
		For(i,2,n)b[i]+=b[i-1];
		memcpy(a,b,sizeof(a));
	}else break;
	For(i,1,n)printf("%d ",a[i]);
	putchar('\n');
	return 0;
}