import Foundation

let line = readLine()!.components(separatedBy: " ").map { Int($0)! }
let N = line[0]
let K = line[1]
var A = readLine()!.components(separatedBy: " ").map { Int($0)! }

var zero = Array.init(repeating: 0, count: N)
var B = zero

let dispatchGroup = DispatchGroup()
let dispatchQueue = DispatchQueue(label: "queue", attributes: .concurrent)

for _ in 0..<K {
    for i in 0..<N {
        dispatchGroup.enter()
        dispatchQueue.async(group: dispatchGroup) {
            let s = 0 < i - A[i] ? i - A[i] : 0
            let e = i + A[i] < N ? i + A[i] : N - 1
            for t in s...e {
                B[t] += 1
            }
            dispatchGroup.leave()
        }
    }

    dispatchGroup.wait()
    A = B
    B = zero
}

let ans = A.map { String($0) }.joined(separator: " ")
print(ans)