#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
using ll = long long;

double expected_value(int n) {
  return (double)((1 + n) * n / 2) / (double)n;
}

int main() {
  int n, k;
  cin >> n >> k;
  vector<double> ps(n + 1);
  vector<double> comsum(n + 1, 0);
  int p;
  rep(i, n) {
    cin >> p;
    ps[i + 1] = expected_value(p);
    comsum[i + 1] = comsum[i] + ps[i + 1];
  }
  double mm = 0;
  for (int i = k; i <= n; i++) {
    mm = max(comsum[i] - comsum[i - k], mm);
  }
  printf("%.6f\n", mm);
  return 0;
}


/**
 *    author        : Sudipta Banik Trisha 
 *    created       : September 10, 2020 5:11 PM
 *    Problem Name  : D - Dice in Line
 *    Problem Limit : 2000 ms , 1024 MB
 *    Problem Url   : https://atcoder.jp/contests/abc154/tasks/abc154_d
 *    @genarated by : ai-virtual-assistant
**/

#include<bits/stdc++.h>
#define ll long long int 
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);

    ll n,k;
    cin >> n >> k;

    vector<ll>v(n);
    for(ll i=0; i<n; i++){
        cin >> v[i];
        v[i] = 1 + v[i];
    }
    for(ll i=1; i<n; i++){
        v[i] = v[i-1] + v[i];
    }
    
    long double mxprob = (long double)v[k-1];
    for(int i=k; i<n; i++) {
        mxprob = max(mxprob , (long double)(v[i] - v[i-k]));
    }

    mxprob = mxprob / (long double)2.0;
    cout << fixed << setprecision(12) << mxprob << endl;

    return 0 ;
}
