#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int N, K;
	cin >> N >> K;
	vector<int> A(N);
	for (auto& x : A) {
		cin >> x;
	}

	for (int n = 1; n <= K; ++n) {
		vector<int> B(N + 1, 0);
		for (int i = 0; i < N; ++i) {
			int l = max(0, i - A[i]);
			int r = min(N, i + A[i] + 1);
			B[l] += 1;
			B[r] -= 1;
		}
		A[0] = B[0];
		for (int i = 1; i < N; ++i) {
			A[i] = A[i - 1] + B[i];
		}
		if (count(A.begin(), A.end(), N) == N) {
			break;
		}
	}
	for (int i = 0; i < N; ++i) {
		cout << A[i] << " ";
	}
	cout << endl;
}
