#include <stdio.h>
int a[200000], tmpa[200000], light[200000] = {0};
int main() {
	int n, k;
	scanf("%d%d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	for (int i = 0; i < n; i++) {
		int r, l;
		r = i - a[i];
		l = i + a[i];
		for (int j = r; j <= l; j++) {
			if (j < 0 || j >= n) {
				continue;
			}
			light[j]++;
		}
	}
	for (int i = 0; i < k; i++) {
		for (int j = 0; j < n; j++) {
			tmpa[j] = a[j];
			a[j] = light[j];
		}
		for (int j = 0; j < n; j++) {
			int r = j - tmpa[j];
			int l = j + tmpa[j];
			for (int k = r; k <= l; k++) {
				if (k < 0 || k >= n) {
					continue;
				}
				light[k]--;
			}
			r = j - a[j];
			l = j + a[j];
			for (int k = r; k <= l; k++) {
				if (k < 0 || k >= n) {
					continue;
				}
				light[k]++;
			}
		}
	}
	for (int i = 0; i < n; i++) {
		printf("%d", a[i]);
		printf(i == n - 1 ? "\n" : " ");
	}
	return 0;
}