program name
    implicit none
    integer(4):: n,k,i
    real(8),allocatable:: p(:),ans(:)
    real(8):: tot

    read*, n,k
    allocate(p(n), ans(n-k+1))
    read*, p(:)

    tot = sum(p(1:k))
    ans(1) = dble(tot+k)/dble(2)

    do i=2,n-k+1
        tot = tot - p(i-1) + p(i+k-1)
        ans(i) = dble(tot+k)/dble(2)
    end do

    print*, maxval(ans)
end program name