program ABC154_D
  integer::N,K
  double precision,allocatable::p(:),a(:),b(:)
  read(*,*)N,K
  allocate(p(N),a(N),b(N))
  read(*,*)p
  do i=1,N
     a(i)=(p(i)+1.0)/2.0
  end do
  b=0
  do i=1,N-K+1
     b(i)=sum(a(i:i+K-1))
  end do
  ans=maxval(b)
  write(*,*)ans
end program ABC154_D