#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define REP(i, n) for(int i=1;i<=n;i++)
typedef long long ll;

int main() {
	ll n, k;
	cin >> n >> k;
	vector<ll> a(n + 1);
	REP(i, n) {
		cin >> a[i];
	}
	while (k--) {
		vector<ll> imos(n+2);
		bool exist = true;
		REP(i, n) {
			if (a[i] != n) exist = false;
		}
		if (exist) break;
		REP(i, n) {
			imos[max(1LL, i - a[i])]++;
			imos[min(n+1, i + a[i] + 1)]--;
		}
		REP(i, n) {
			if (i > 0) imos[i] += imos[i-1];
			a[i] = imos[i];
		}
	}
	REP(i, n) {
		cout << a[i] << endl;
	}
	
	return 0;
}