#include <bits/stdc++.h>
using namespace std;
 
int main() {
long long int n,k,p;cin>>n>>k;
  double x[n],sum=0,sum_next=0,ans;
  for (int i=0;i<n;i++){cin>>p;x[i]=(1+p)/2.0;}
  for(int i=0;i<k;i++)sum+=x[i];
  ans=sum;
  
 for(int i=1;i<n-k+1;i++){
   sum = sum - x[i-1] + x[i+k-1];
   ans=max(sum,ans);
 }
  printf("%.16f\n", ans);
}
   