let (n, k) = readInts().mapToTuple()
var As = readInts()

for _ in 1...k {
    var new = Array(repeating: 0, count: n)
    for (i, a) in As.enumerated() {
        for j in max(i - a, 0)...min(i + a, n - 1) {
            new[j] += 1
        }
    }
    As = new
}

for a in As {
    print(a, terminator: " ")
}
print()


func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

extension Collection {
    func mapToTuple() -> (Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!)
    }
    func mapToTuple() -> (Element, Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!, i.next()!)
    }
    func mapToTuple() -> (Element, Element, Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!, i.next()!, i.next()!)
    }

    subscript(gen: Index) -> Element {
        _modify { yield &self[index(gen, offsetBy: -1)] }
        _read   { yield self[index(gen, offsetBy: -1)] }
    }
}
