program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: n,k,i,j,l,r,jj
    integer(int64), allocatable:: a(:), na(:)
    logical:: same

    read*, n,k
    allocate(a(n), na(n))
    read*, a(:)


    ! if (k >= 100) then
    !     a(:) = n
    !     print'(*(i0,1x))', a(:)
    !     stop
    ! end if

    do i=1,k
        na(:) = 0
        same = .true.
        do j=1,n
            l = max(j-a(j),1_8)
            r = min(j+a(j),n)
            na(l:r)=na(l:r)+1
        end do
        a(:) = na(:)
    end do
    ! print'(i0)', i
    print'(*(i0,1x))', na(:)
end program main