#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<string.h>
#include<math.h>
#include<ctype.h>

#define MOD 1e7+7
typedef long long ll;

ll mygcd(ll a, ll b) { if (b == 0) return a; return mygcd(b, a % b); }

ll mylcm(ll a, ll b) { return a / mygcd(a, b) * b; }

ll mymax(ll a, ll b) { return (a > b) ? a : b; }

ll mymin(ll a, ll b) { return (a < b) ? a : b; }

ll myasc(const void* a, const void* b) { return *(ll*)a - *(ll*)b; }

ll mydsc(const void* a, const void* b) { return *(ll*)b - *(ll*)a; }

ll n, k, a[200000], b[2000001];

int main() {
	scanf("%lld%lld", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
	}
	for (int i = 0; i < k; i++) {
		bool flag = true;
		for (int j = 0; j < n; j++) b[j] = 0;
		for (int j = 0; j < n; j++) {
			b[mymax(0, j - a[j])]++;
			b[mymin(n, j + a[j]+1)]--;
		}
		a[0] = b[0];
		for (int j = 1; j < n; j++) a[j] = a[j - 1] + b[j];
		for (int j = 0; j < n; j++) {
			if (a[j] != n) flag = false;
		}
		if (flag) {
			for (int j = 0; j < n; j++) printf("%lld ", n);
			return 0;
		}
	}
	for (int i = 0; i < n; i++) {
		printf("%lld ", a[i]);
	}
	return 0;
}