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

#define rep(i,k,n) for(int (i)=(k);(i)<(n);(i)++)
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
#define abs(a) (a)>0 ?(a):-(a)
#define llong long long

int main(){
	int N,K; scanf("%d %d",&N,&K);
	int a[N];
	rep(i,0,N) scanf("%d",&a[i]);
	int lamp[N],plus[N];
	rep(i,0,N) lamp[i]=0;
	rep(i,0,N){
		int min = max(0,i-a[i]);
		int max = min(N,i+a[i]+1);
		rep(j,min,max){
			lamp[j]++;
		}
	}
	
	rep(k,0,K){
		rep(i,0,N) plus[i]=0;
		rep(i,0,N){
			int d = lamp[i]-a[i];	// 広がる範囲
			int min = max(0,i-lamp[i]);
			rep(j,min,i-a[i]) plus[j]++;
			int max = min(N,i+lamp[i]+1);
			rep(j,i+a[i]+1,max) plus[j]++;
		}
		rep(i,0,N) a[i] = lamp[i];
		rep(i,0,N) lamp[i]+=plus[i];
	}
	
	rep(i,0,N) printf("%d ",a[i]);
		
	return 0;
}
