#include <stdio.h>

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

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

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

	int mode = 0;
	int min = 0;
	int max = 0;
	int flag = 0;
	for (int i = 0; i < k; i++) {
		flag = 0;
		for (int j = 0; j < n; j++) {
			min = j - a[j];
			max = j + a[j];
			if (min == 0 && max == 0) {
				b[j]++;
			}
			else {
				if (min < 0) {
					min = 0;
				}
				if (max >= n) {
					max = n-1;
				}
				for (int x = min; x <= max; x++) {
					b[x]++;
				}
			}
			if (b[j] >= n) {
				flag++;
			}
		}
		if (flag >= n) {
			for (int j = 0; j < n; j++) {
				b[j] += (k - i - 1) * n;;
			}

			for (int i = 0; i < n; i++) {
				printf("%d ", b[i]);
			}
			return 0;
		}
		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;
}