((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 < 41; i++) {	//  k回繰り返す
		let q = new Array(n).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]++;
			}
		}
		a = q.slice(0, n);
		if (a[0] === n && a[n - 1] === n) {
			break;
		}
	}

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