let split_string ?(pattern="") = Str.split @@ Str.regexp pattern
let n, k = Scanf.sscanf (read_line ()) "%d %d" @@ fun n k -> (n, k)
let a = read_line () |> split_string ~pattern:" " |> List.map int_of_string |> Array.of_list

let print_array arr = arr 
  |> Array.to_list 
  |> List.map string_of_int 
  |> String.concat " " 
  |> print_endline

let f a =
  let b = Array.make n 0 in
  Array.iteri (fun i a ->
    let l, r = max 0 (i - a), min (n - 1) (i + a) in
    b.(l) <- b.(l) + 1;
    if r + 1 < n then b.(r + 1) <- b.(r + 1) - 1
  ) a;
  for i = 1 to n - 1 do b.(i) <- b.(i) + b.(i - 1) done;
  b

let rec loop i b =
  if i = min k 41 then b
  else loop (i + 1) (f b)

let () = print_array @@ loop 0 a