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

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

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

    print*, maxval(ans)
end program name