program main
    implicit none
    integer(4):: n,k,i,j
    integer(4),allocatable:: p(:)
    real(8),allocatable:: s(:)
    real(8):: ans=0
    read*, n, k
    allocate(p(n),s(n))
    read*, p(:)

    s(:) = dble(p(:)-1)/2d0+1

    do i=1,n-k+1
        ans = max(ans, sum(s(i:i+k-1)))
    end do
    print*, ans
end program main