      PROGRAM Lamps
      implicit none
      integer,parameter :: p = 16
      integer(p) :: n,k
      integer(p), allocatable :: a(:)
      
      integer(p) :: i,j, left,right
      integer(p), allocatable :: ant(:),post(:)
      
      
      read*,n,k
      allocate( a(n),ant(n),post(n+1) )
      read*,a(1:n)
      
      ant = a
      do j = 1,k
        post = 0
        do i = 1,n
          left  = max( 1,i-ant(i) )
          right = min( n,i+ant(i) )
          
          right = right + 1
          post(left) = post(left) + 1
          post(right) = post(right) - 1
        end do
        
        do i = 2,n
          post(i) = post(i) + post(i-1)
        end do
        
        if( all(ant(1:n)==post(1:n)) ) exit
        
        ant = post
        
      end do
      
      print'(*(i0,x))',post(1:n)
      
      
      
      END PROGRAM