#include <bits/stdc++.h>
using namespace std;
int main() {
  cout.precision(9);
  int N, K;
  cin >> N >> K;
  vector<double> p(N, 0);
  double temp = 0;
  for (int i = 0; i < N; i++) {
    cin >> temp;
    p[i] = (temp / (double)2.) + 0.5;
  }
  double ans = 0;
  for (int i = 0; i < K; i++) ans += p[i];
  if (N == K) {
    cout << ans << endl;
  } else {
    double maxi = ans;
    for (int i = K; i < N; i++) {
      ans += (p[i] - p[i - K]);
      maxi = max(maxi, ans);
    }
    cout << maxi << endl;
  }
  return 0;
}
