#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<double> op(N);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    op.at(i) = a;
  }
  double f = 0;
  for (int j = 0; j < N - M + 1; j++) {
    double v = 0;
    for (int i = j; i < M + j; i++) {
      double p = op.at(i);
      v = v + p * (p + 1) / 2 / p;
    }
    f = max(f, v);
  }
  cout << f;
}
