void main(){
	int n, k;
	readf("%d %d\n", &n, &k);
	double[] p = _scanln!double();
	double[] pw;
	double prev = 0.0;
	// 各サイコロの累積期待値
	foreach(i; 0..n){
		pw ~= (1 + p[i])/2 + prev;
		prev += (1 + p[i])/2;
	}
	double ans = 0.0;
	foreach(i; k-1..n){
		if(i<k)ans = max(ans, pw[i]);
		else ans = max(ans, pw[i]-pw[i-k]);
	}
	ans.writeln();
}

import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math, std.range;

// 1要素のみの入力
T _scan(T= int)(){
	return to!(T)( readln().chomp() );
}

// 1行に同一型の複数入力
T[] _scanln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split()){
		ln ~= elm.to!T();
	}
	return ln;
}
