#include<bits/stdc++.h>
using namespace std;
double a[200005];
int n, k;
double ans;
int main() 
{
	cin >> n >> k;
	for(int i = 0; i < n; i++)
	{
		cin >> a[i];
		a[i] = (1 + a[i]) / 2.0;
	}
	for(int i = 0; i < k; i++)
		ans += a[i];
	double x = ans;
	for(int i = k;i < n; i++)
	{
		x = x + a[i] - a[i - k];
		ans = max(x,ans);
	}
	printf("%0.10lf\n", ans);
	return 0;
	
}