#include<bits/stdc++.h>
#define pb emplace_back
using namespace std;
using ll = long long;
const int maxn = 300010;
int n, k, a[maxn], b[maxn];
signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> n >> k;
	for (int i = 1;i <= n;++i) 
		cin >> a[i];
	while (k--) {
		if (*min_element(a+1, a+n+1) == n) break;
		for (int i = 1;i <= n;++i) 
			++b[ max(1, i-a[i]) ], --b[ min(n+1, i+a[i]+1) ];
		for (int i = 1;i <= n;++i)
			a[i] = b[i] += b[i-1];
		fill(b, b+n+1, 0);
	}
	for (int i = 1;i <= n;++i)
		cout << a[i] << " \n"[i==n];

			
}

