#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K;
  cin >> N >> K;
  vector<int> P(N);
  double E;
  vector<double> S(N);
  for (int i = 0; i < N; i++) {
    cin >> P.at(i);
  }
  double result = 0;
  double tmp = 0;
  S.at(0) = (P.at(0) + 1) / 2.0;
  for (int i = 0; i < N - 1; ++i) {
    E = (P.at(i + 1) + 1) / 2.0;
    S.at(i + 1) = S.at(i) + E;
  }
  result = S.at(0);
  for (int i = 1; i < N - K + 1; i++) {
    tmp = S.at(K + i - 1) - S.at(i - 1);
    if (result < tmp) result = tmp;
  }
  cout << result << endl;
  return 0;
}
