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

typedef long long ll;
typedef pair<int,int> pii;

long long MOD = 10000000000 + 7;

int main(){
  cout << setprecision(10);
  int N,K; cin >> N >> K;
  vector<ll> v(N+1,0);

  for(int i = 0; i < N; i++){
    ll tmp; cin >> tmp;
    v[i+1] = tmp;
  }

  for(int i = 1; i <= N; i++){
    v[i] = v[i] + v[i-1];
  }

  ll max_val = 0;
  for(int i = N; i - K >= 0; i--){
    max_val = max(max_val, v[i] - v[i - K]);
  }
  cout << (double)(max_val+K) / 2.0 << endl;

}

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define repi(i, x) \
	for (auto i = (x).begin(), i##_fin = (x).end(); i != i##_fin; i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a) ? "Yes" : "No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int, int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long, long long> P;
typedef vector<P> VP;
template <class T>
inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return 1;
	}
	return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return 1;
	}
	return 0;
}
const long long INFLL = 1LL << 60;
const int INF         = 1 << 30;
const double PI       = acos(-1);
int main() {
	int n;
	int k;
	cin >> n >> k;
	vector<double> p(n);
	double ans = 0.0, cnt = 0.0;

	rep(i, n) {
		cin >> p[i];
		p[i] = (p[i]*(p[i]+1.0)/2.0) / p[i];
		clog << p[i] << endl;
		cnt += p[i];
		if (i >= k) {
			cnt -= p[i - k];
		}
		chmax(ans, cnt);
		// clog << cnt << endl;
	}

	printf("%.9lf\n", ans);
}