#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,K;
  cin >> N >> K;
  double A[N];
  double max = 0.0,sum = 0.0;
  
  for(int i = 0; i < N; i++){
    double a;
    cin >> a;
    A[i] = ((1.0+a)*a/2.0)/a;
    sum += A[i];
    if(i >= K) sum -= A[i-K];
    if(sum >= max) max = sum;
  }
  printf("%f\n", max);
}