import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto K = s[1];
    auto A = readln.split.map!(to!long).array;

    auto B = new real[](N+1);
    B[] = 0;
    foreach (i; 0..N) B[i+1] = B[i] + (A[i] + 1) / 2.0L;
    real ans = 0;

    foreach (i; 0..N-K+1) {
        auto v = B[i+K] - B[i];
        ans = max(ans, v);
    }

    writefln("%.15f", ans);

}
