#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<double> v;
  double temp;
  for (int i = 0; i < n; ++i) {
    cin >> temp;
    if (i == 0) {
      v.push_back((temp + 1) / 2);
    } else {
      v.push_back(v[i - 1] + (temp + 1) / 2);
    }
  }
  double res = v[k - 1];
  for (int i = 0; i < n - k; ++i) {
    double sum_i = v[k + i] - v[i];
    if (res < sum_i) {
      res = sum_i;
    }
  }
  cout << res << endl;
  return 0;
}
