import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List
import Data.Array

main = do
  li <- BS.getLine
  let [n,k] = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  li <- BS.getLine
  let as = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  let ans = compute n k as
  putStrLn $ unwords $ map show ans

{- いもす法、累積和、の方がまともな名前だ。
立ち上がりと立下りを一つの配列に累積し、それをなぞることで各ポイントの値を一気に取りだす
-}
compute :: Int -> Int -> [Int] -> [Int]
compute n k as = iterate (step n) as !! k

step :: Int -> [Int] -> [Int]
step n as = scanl1 (+) $ elems $ accumArray (+) 0 (1,n) imar
  where
    imar =
      [p
      | (i,a) <- zip [1..] as
      , p <- [(max 1 (i-a),1)] ++ [(j,-1) | let j = i+a+1, j <= n]
      ]

{- naive code : TLE
compute n k as = elems $ iterate (step n) (listArray (1,n) as) !! k
step n ar = accumArray (+) 0 (1,n) [ (j,1) | i <- [1..n], j <- [max 1 (i - ar ! i)..min n (i + ar ! i)] ]
-}
