program dice_in_line
  implicit none
  integer :: n, k, p(200000) = 0, s(0:200000) = 0, i, m = 0
  read(*,*) n, k
  read(*,*) p(1:n)
  do i = 1, n
    s(i) = s(i-1)+p(i)
  end do
  do i = k, n
    m = max(m,s(i)-s(i-k)+k)
  end do
  write(*,'(i0)',advance='no') m/2
  if (mod(m,2) == 1) write(*,'(a)',advance='no') ".5"
  write(*,*)
end program dice_in_line