#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  double l;
  double sum = 0;
  cin >> n >> k;
  vector<double> p(n + 1);
  p[0] = 0;
  double ans = 0;
  for (int i = 0; i < (n); ++i) {
    cin >> l;
    sum += (l + 1) / 2;
    p[i + 1] = sum;
    if (i + 1 >= k) ans = max(ans, p[i + 1] - p[i + 1 - k]);
  }
  cout << ans;
}
