function Main(arg)
{
  var N = arg.split("\n")[0].split(" ")[0]-0;
  var K = arg.split("\n")[0].split(" ")[1]-0;
  var p = arg.split("\n")[1].split(" ").map(v => v - 0.0);
  var a = new Array(N);
  var s = new Array(N);
  s.fill(0);

  for (var i = 0; i < N; i++){
    a[i] = (p[i] + 1) / 2.0;
    if (i == 0) s[i] = a[i];
    else s[i] = a[i] + s[i - 1];
  }

  var ans = new Array(N);
  ans.fill(0);
  for (var i = 0; i < N; i++) {
    if (i + K == N) break;
    ans[i]=(s[i+K]-s[i]);
  }

  console.log(ans.reduce((a,b)=>Math.max(a,b)));
  return;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
