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

#define min(a, b) (a) < (b) ? (a) : (b)
#define max(a, b) (a) > (b) ? (a) : (b)

int *get_changed_light(int *current, int N) {
	int *after = calloc(1, (1 + N) * sizeof(int));
	// 一つずつ照らす範囲を求めてカウントアップする
	for (int i = 1; i <= N; i++) {
		int min_axis = max(i - current[i], 1);
		int max_axis = min(i + current[i], N);
		//printf("light: %d, from: %d, to: %d\n", i, min_axis, max_axis);
		for (int j = min_axis; j <= max_axis; j++) {
			after[j] += 1;
		}
	}
	free(current);
	return after;
}

int main() {
	int N;
	int K;
	scanf("%d", &N);
	scanf("%d", &K);
	int *A = malloc((1 + N) * sizeof(int));
	for(int i = 1; i <= N; i++) {
		scanf("%d", &A[i]);
	}
	int *current = A;
	for (int i = 1; i <= K; i++) {
		current = get_changed_light(current, N);
	}
	for(int i = 1; i < N; i++) {
		printf("%d ", current[i]);
	}
	printf("%d\n", current[N]);

	return 0;
}
