#include <bits/stdc++.h>
using namespace std;
long long int MOD = 998244353;
long long int mod = 1e9 + 7;
long long int INF = 1e18;
int main() {
  long long int n, k;
  cin >> n >> k;
  double a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = (a[i] + 1) / 2;
  }
  double b[n + 1];
  b[0] = 0.0;
  for (int i = 1; i < n; i++) b[i] = a[i - 1] + b[i - 1];
  double ans = 0.0;
  for (int i = 0; i < n - k + 1; i++) ans = max(ans, b[i + k] - b[i]);
  cout << fixed << ans;
  return 0;
}
