import Foundation

private func readWords<T>(_ f: (Substring) -> T) -> [T] {
    return readLine()!.split(separator: " ").map(f)
}

prefix operator *
prefix func *<T>(a: inout IndexingIterator<[T]>) -> T {
    return a.next()!
}

func mainC() {
    var nk = readWords { Int($0)! }.makeIterator()
    let n = *nk
    let k = min(50, *nk)
    
    var A = readWords { Int($0)! }
    
    for _ in 1...k {
        var B = [Int](repeating: 0, count: n+1)
        for (i, a) in A.enumerated() {
            let l = max(0, i - a)
            let r = min(n, a + i + 1)
            B[l] += 1
            B[r] -= 1
        }
        
        var total = 0
        for i in 0..<n {
            A[i] = total + B[i]
            total = A[i]
        }
    }
    
    print(A.map{ $0.description }.joined(separator: " "))
    
}

mainC()
