program kadai
integer  ::  N,K
integer,allocatable  ::  p(:)
real(8)  ::  ans,ans_max

read(*,*) N,K
allocate(p(N))
read(*,*) p

ans=0.0_8
do i=1,K
    ans=ans+p(i)
end do
ans_max=ans

do i=1,N-K
    ans=ans-p(i)
    ans=ans+p(i+K)
    !write(*,*) ans,ans_max
    ans_max=max(ans,ans_max)
end do
write(*,*) (ans_max+real(K,8))/2.0_8

end program kadai