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