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

int main()
{
	int n, k, *a=NULL, *b=NULL;
	int i, l, r, flag;
	scanf("%d%d", &n, &k);
	if ((a = (int *)malloc(sizeof(int) * n)) == NULL) return -1;
	if ((b = (int *)malloc(sizeof(int) * n)) == NULL) return -1;
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	while (k--) {
		memset(b, 0, sizeof(int) * n);
		for (i = 0; i < n; i++) {
			l = i - a[i];
			r = i + a[i] + 1;
			if (l < 0) l = 0;
			b[l]++;
			if(r < n) b[r]--;
		}
		flag = a[0] == b[0];
		a[0] = b[0];
		for (i = 1; i < n; i++) {
			b[i] += b[i - 1];
			if (b[i] < 0) {
				b[i] = b[i];
			}
			flag &= (a[i] == b[i]);
			a[i] = b[i];
		}
		if (flag) {
			break;
		}
	}
	for (i = 0; i < n; i++) {
		if (i > 0) printf(" ");
		printf("%d", a[i]);
	}
	puts("");
	return 0;
}
