#include <stdio.h>

int main(void) {
	int n, k;
	int a[200000] = { 0 };
	int b[200000] = { 0 };

	scanf("%d", &n);
	scanf("%d", &k);

	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}

	int mode = 0;
	for (int i = 0; i < k; i++) {
		for (int j = 0; j < n; j++) {
			for (int x = 0; x < n; x++) {
				if (j - a[j] <= x && x <= j + a[j]) {
					b[x]++;
				}
			}
		}
		for (int i = 0; i < n; i++) {
			a[i] = b[i];
			b[i] = 0;
		}
	}

	for (int i = 0; i < n; i++) {
		printf("%d ", a[i]);
	}

	return 0;
}