function qwerty(a) {
	let q = new Array(a.length).fill(0);

	for (let i = 0; i < a.length; i++) {
		q[i]++;
		for (let j = 1; j <= a[i]; j++) {
			q[i + j]++;
			q[i - j]++;
		}
	}

	return q.slice(0, a.length);
}

((stdin) => {
	let [l1, l2] = stdin.split('\n');
	let [n, k] = l1.split(' ');
	[n, k] = [+n, +k];
	let a = l2.split(' ');

	for (let i = 0; i < n; i++) {
		a[i] = +a[i];
	}

	for (let i = 0; i < k; i++) {	//  k回繰り返す
		a = qwerty(a);
	}

	console.log(a.join(' '));
})(require("fs").readFileSync("/dev/stdin", "UTF-8"));