program main

  implicit none

  integer    :: n, k
  integer,allocatable :: p(:)
  real   ,allocatable :: sp(:)
  real   ,allocatable :: h(:)
  real   ,allocatable :: sh(:)
  integer :: i, j 
  
  read(*,*) n, k
  allocate( p(n) )
  allocate( h(n) )
  read(*,*) p

  allocate( sp(maxval( p )) )
  j = 0
  do i = 1, maxval( p )
    j = j + i
    sp(i) = j
  end do

  do i = 1, n
    h(i) = sp(p(i)) / p(i) 
  end do

  allocate( sh(n-k+1) )
  do i = 1, n-k+1
    sh(i) = sum( h(i:i+k-1) )
  end do
  
  print*, maxval( sh )
end program main
