      PROGRAM piyo
      IMPLICIT NONE
      INTEGER,PARAMETER :: prec = 16
      integer(prec) :: n,k
      integer(prec),allocatable :: a(:),b(:),s(:)
      integer(prec) :: i,j,left,right
      
      read*,n,k
      allocate( a(n),b(n),s(n) )
      read*,a(1:n)
      
      s = a
      do j = 1,k
        b = 0_prec
        do i = 1,n
          left  = max( 1,i-s(i) )
          right = min( n,i+s(i) )
          b(left:right) = b(left:right) + 1
        end do
        
        if( all(s==b) )then
          print*,b
          stop
        else
          s = b
        end if
      end do
      
      print*,b 
      
      
      
      stop
      !debugg
      
      
      
      END PROGRAM