      PROGRAM piyo
      IMPLICIT NONE
      integer(16) :: n,k
      integer(16),allocatable :: p(:)
      real(8),allocatable :: re(:)
      integer(16) :: i,loc,ma,buffer
      
      read*,n,k
      allocate( p(n) )
      read*,p(:)
      
      
      loc = 1;ma = sum( p(1:k) )
      do i = 2,n-k+1
        !buffer = sum( p(i:i+k-1) )
        buffer = buffer - p(i-1) + p(i+k-1)
        if( buffer>ma ) then
          loc = i
          ma = buffer
        end if
      end do
      
      allocate( re(k) )
      re = p(loc:loc+k-1)
      
      
      print*,sum( (re+1.)/2. )
      
      
      END PROGRAM