#include <cstdio>

const int MN = 200005;

int N, K, A[MN], B[MN];

int main() {
	scanf("%d%d", &N, &K);
	for (int i = 1; i <= N; ++i) scanf("%d", &A[i]);
	while (K--) {
		for (int i = 1; i <= N; ++i) B[i] = 0;
		for (int i = 1; i <= N; ++i) {
			int l = i - A[i], r = i + A[i];
			l = l < 1 ? 1 : l;
			r = r > N ? N : r;
			++B[l], --B[r + 1];
		}
		for (int i = 1; i <= N; ++i) A[i] = A[i - 1] + B[i];
		int ok = 1;
		for (int i = 1; i <= N; ++i) if (A[i] != N) ok = 0;
		if (ok) break;
	}
	for (int i = 1; i <= N; ++i) printf("%d%c", A[i], " \n"[i == N]);
	return 0;
}