"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const N = parseInt(inputList[0].split(" ")[0]);
    const K = parseInt(inputList[0].split(" ")[1]);
    let ALightList = inputList[1].split(" ").map(ele => parseInt(ele));

    if (K >= N) {
        console.log(Array(ALightList.length).fill(N).join(" "))
    } else {
        for (let i = 0; i < K; i++) {
            const changeSumList = Array(ALightList.length).fill(0);
            for (let j = 0; j < ALightList.length; j++) {
                const minus = (j - ALightList[j]) < 0 ? 0 : j - ALightList[j];
                const plus = j + ALightList[j] > N ? N : j + ALightList[j];
                for (let k = minus; k <= plus; k++) {
                    changeSumList[k]++;
                }
            }
            ALightList = changeSumList.map(ele => ele > N ? N : ele);
        }
        console.log(ALightList.join(" "))
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));