local mmi, mma = math.min, math.max
local n, k = io.read("*n", "*n")
local a = {}
for i = 1, n do
  a[i] = io.read("*n")
end
local imos = {}

local function work()
  for i = 1, n + 1 do
    imos[i] = 0
  end
  for i = 1, n do
    local v = a[i]
    local left = mma(1, i - v)
    local right = 1 + mmi(n, i + v)
    imos[left] = imos[left] + 1
    imos[right] = imos[right] - 1
  end
  local z = 0
  local isinf = true
  for i = 1, n do
    z = z + imos[i]
    a[i] = z
    if a[i] < n then isinf = false end
  end
  return isinf
end
for i = 1, k do
  local ret = work()
  if ret then break end
end
print(table.concat(a, " "))
