#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<double> p(n);
  for (long long i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    p[i] = (1 + temp) / 2.0;
  }
  vector<double> sp(n);
  for (long long i = 0; i < n; i++) {
    if (i == 0) {
      sp[i] = p[i];
    } else {
      sp[i] = sp[i - 1] + p[i];
    }
  }
  double ans = sp[k - 1];
  for (long long i = k; i < n; i++) {
    ans = max(ans, sp[i] - sp[i - k]);
  }
  cout << fixed << setprecision(ans) << endl;
}
