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

    s(1:) = dble(p(:)-1)/2d0+1
    s(0) = 0
    do i=1,n
        s(i) = s(i) + s(i-1)
    end do


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