program Beg4
  implicit none
  integer :: N,K, i , j
  integer, allocatable:: p(:)
  real,allocatable :: ssum(:)
  real :: smax

  read(*,*) N, K
  allocate(p(N))
  allocate(ssum(N-K+1))

  read(*,*) (p(j), j=1,N)
  ssum=0.0
  smax=0.0
  do i=1,N-K+1
     do j=i,i+K-1
        ssum(i)=ssum(i)+dble(p(j)+1)/2.0
     enddo
  enddo
  print*, maxval(ssum)


end program Beg4