import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }

void main() {
  auto NK = readln.split.to!(ulong[]);
  auto K = NK[1];
  auto P = readln.split.to!(ulong[]);

  void solve() {
    ulong max = P[0..K].sum;
    ulong maxIndex = 0;
    ulong current = max;

    foreach(i; K..NK[0]) {
      current += P[i] - P[i-K+1];

      if (max < current) {
        max = current;
        maxIndex = i-K+1;
      }
    }

    double sum = 0;
    foreach(i; P[maxIndex..maxIndex+K]) {
      sum += cast(double)(i+1) / 2.0f;
    }
    writefln("%.10f", sum);
  }

  solve();
}
