program main
    implicit none
    integer n,k
    integer i,j,l
    integer, allocatable, dimension(:) :: a, b

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

    do l = 1,k

        b = 0
        do i = 1,n
            do j = i-a(i), i+a(i)
                if(j >= 1 .and. j <= n) then
                    b(j) = b(j) + 1
                end if
            end do
        end do

        do i = 1,n
            a(i) = b(i)
        end do

    end do
    write(*,*) a

end program

