! 2020.2.9
!
      program answer
      implicit none
      integer :: N,K
      integer,allocatable,dimension(:) :: p
      integer,allocatable,dimension(:) :: su_p
      integer :: ans
      integer :: i,j
!
      read(*,*) N,K
      allocate(p(N),su_p(N-K+1))
      read(*,*) (p(i),i=1,N)
!
      su_p = 0
      do i=1,N-K+1
        do j=i,i+K-1
          su_p(i) = su_p(i) + p(j)
        end do
        if(i > 1) then
          if(su_p(i) > su_p(i-1)) ans = su_p(i)
        end if
      end do
      write(*,*) dble(ans+K)/2.0d0
      end program answer