#include <iostream>
#include <algorithm>
#include <iomanip>

double avg(int n) {
	return (n+1)/2.0;
}

int main() {
	int n, k, p[2000010];
	std::cin >> n >> k;

	for (int i = 0; i < n; ++i)
		std::cin >> p[i];

	double sum = 0;
	for (int i = 0; i < k; ++i) {
		sum += avg(p[i]);
	}


	double ans = sum;
	for (int i = k; i < n; ++i) {
		sum -= avg(p[i-k]);
		sum += avg(p[i]);

		ans = std::max(ans, sum);
	}

	std::cout << std::setprecision(10) << std::fixed << ans;
}
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,K; cin>>N>>K;
  vector<int>A(N);
  vector<long double>sum(N+K);
  for(int i=0;i<N;i++){
    cin>>A[i];
    sum[i]+=A[i]+1;
    sum[i+K]-=A[i]+1;
  }
  for(int i=1;i<N+K;i++)sum[i]+=sum[i-1];
  sort(sum.begin(),sum.end());
  cout<<fixed<<setprecision(10)<<sum[N+K-1]/2<<endl;
}