program main
implicit none
integer :: n, k, l, i
integer , allocatable :: p(:), q(:)

read(*,*) n, k
allocate( p(n) )
read(*,*) p
l = n - k + 1
allocate( q(l) )
do i = 1, l
   q(i) = sum((p(i:i+k-1)+1)/2.)
end do
write(*,*) dble(maxval(q))

end program main