program sample
    implicit none
  
    integer(8) :: i,j,m,n,k,a
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) n,k
    allocate(x(n))
    read(*,*)x
    a=0
    do i=1,k
        a=a+x(i)
    end do
    m=a
    do i=1,n-k
        a=a-x(i)+x(k+i)
        if(a>m)then
            m=a
        end if
    end do
    write(*,*) (m+k)/2.0
  
    stop
end program sample
  

