#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int MAX = 1000000;
const int mod = 1000000007;
const double pi = 3.141592653589;
int main() {
  int n, k;
  cin >> n >> k;
  vector<double> E(n);
  double dice;
  for (int i = 0; i < n; i++) {
    cin >> dice;
    E[i] = (dice + 1.0) / 2.0;
  }
  double max_E = 0.0;
  for (int i = 0; i < k; i++) {
    max_E += E[i];
  }
  double tmp = max_E;
  for (int i = k; i < n; i++) {
    tmp += E[i];
    tmp -= E[i - k];
    max_E = max(max_E, tmp);
  }
  cout << fixed << setprecision(7) << max_E << '\n';
  return 0;
}
