#include <bits/stdc++.h>
using namespace std;
int main()
  {int N, K; cin >> N >> K;
  int s = 0, m = 0;
  vector<int> ps(N); for (auto &p : ps) cin >> p;
  for (int i = 0; i < N; ++i)
    {s += ps[i];
    if (i >= K) s -= ps[i - K];
    m = max(m, s);}
  cout << fixed << setprecision(12) << 0.5 * (m + K) << endl;}