program c613

implicit none
integer :: n, k, i, j, h
integer, allocatable :: a(:), b(:)

read *, n, k
allocate(a(1:n))
allocate(b(1:n))

read *, a(:)

b(:) = 0

do h = 1, k
 do i = 1, n
  do j = i - a(i), i + a(i)
   b(j) = b(j) + 1
  end do
 end do
 a(:) = b(:) 
end do

print *, a(:)

end program c613