import std.stdio, std.conv, std.string, std.algorithm,
       std.math, std.array, std.container, std.typecons;

void main() {
  long n, k;
  readf("%d %d\n", n, k);
  long[] p = readln.chomp.split.to!(long[]);
  long x = 0;
  for(long i=0; i<k; i++) {
    x += p[i];
  }
  long maxx = x;
  long maxxi = 0;
  for(long i=k; i<n; i++) {
    x = x-p[i-k]+p[i];
    if(x>maxx) {
      maxx=x;
      maxxi=i-k+1;
    }
  }
  double result = 0;
  for(long i=maxxi; i<maxxi+k; i++) {
    result += (p[i]+1)/2.0;
  }
  writef("%.15f\n", result);
}

