import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  int n, k;
  readf("%s %s\n", &n, &k);
  auto p = readln.chomp.split.to!(int[]);
  auto di = new double[](1001);
  di[0] = 0;
  foreach (i; 1..1001) {
    di[i] = di[i-1] + i;
  }
  
  double sum = 0;
  foreach (i; 0..k) {
    sum += di[p[i]] / p[i];
  }
  auto res = sum;
  foreach (i; 1..n-k+1) {
    sum -= di[p[i-1]] / p[i-1];
    sum += di[p[i+k-1]] / p[i+k-1];
    res = max(res, sum);
  }
  writefln("%.12f", res);
}
