program main
	implicit none
    integer i,j,n,k
    integer,allocatable :: p(:),q(:)
    
    read(*,*) n,k
    allocate(p(n))
    read(*,*) (p(i),i=1,n)
    allocate(q(n-k+1))
    q(:)=0
    do i=1,k
       q(1)=q(1)+p(i)
    end do    
    do i=2,n-k+1
       q(i)=q(i-1)-p(i-1)+p(i+k-1)
    end do

    write(*,'(f0.12)') real(maxval(q)+k)/2.0e0
end program main