#include <bits/stdc++.h>
using namespace std;
long long n, k, x, maxi;
long long s[200005];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    s[i] = s[i - 1] + x;
  }
  for (int i = k; i <= n; i++) {
    maxi = max(maxi, s[i] - s[i - k]);
  }
  cout << (double)(maxi + k) / 2;
  return 0;
}
