#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int n, k;
double p[200005], ac, m;
int main(){
	scanf("%d%d", &n, &k);
	rep(i,n){
		scanf("%lf", p+i+1);
		p[i+1] = (p[i+1] + 1) / 2;
		ac += p[i+1];
		if(i+1 >= k){
			ac -= p[i+1-k];
			m = max(m,ac);
		}
	}
	printf("%.9f\n",m);
}