
function main(input) {
    const [NK, As] = input.trim().split('\n')
    const [N, K] = NK.split(' ').map(n => Number(n))
    let A = As.split(' ').map(n => Number(n))

    for(let k = 0; k < K; k++) {
        const newA = new Array(N).fill(0)

        for(let i = 0; i < N; i++) {
            for(let j = -A[i]; j <= A[i]; j++) {
                const index = i + j
                if(0 <= index && index < N) {
                    newA[index]++
                }
            }
        }
        A = newA
    }

    console.log(A.join(' '))
}

main(require("fs").readFileSync("/dev/stdin", "utf8"))
