#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n, k; cin >> n >> k;
  vector<int> sum(n+1); sum[0] = 0;
  for (int i = 0; i < n; ++i)
  {
    int p; cin >> p;
    sum[i+1] = sum[i] + p+1;
  }
  
  int ma = 0;
  for (int i = 0; i + k < n+1; ++i)
    ma = max(ma, sum[i+k] - sum[i]);
  
  printf("%.15f\n", ma / 2.0);
}