import std.stdio;
import std.conv;
import std.array;
import std.string;

uint[] readArray(uint n) {
	auto a = new uint[n];

	foreach (ref e;a) {
		uint u;
		readf(" %s", &u);
		e = u;
	}

	return a;
}

void main() {
	auto nk = readln.chomp.split(" ");
	auto n = nk[0].to!uint;
	auto k = nk[1].to!uint;

	auto p = readArray(n);
	uint sum = 0;
	uint max = 0;

	foreach (e;p[0..k]) {
		sum += e;
	}
	max = sum;

	foreach (i;1..p.length - k + 1) {
		sum -= p[i - 1];
		sum += p[i + k - 1];

		if (sum > max) {
			max = sum;
		}
	}

	writeln((cast(real)max + k) / 2);
}
