#include<bits/stdc++.h>
using namespace std;
int a[200001];
int main(){
int n,k;
cin>>n>>k;
for(int i=0;i<n;i++){
  cin>>a[i+1];
   a[i+1]+=a[i];
}
int ans=0;
for(int i=k;i<=n;i++){
  ans = max(ans,a[i]-a[i-k]);
 }
cout<<fixed<<setprecision(9)<<(double)(ans+k)/2.0<<endl;                 
}