#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, a[100000];
  double ans = 0;
  int max = 0;
  cin >> n >> k;
  int num = 0, num1 = 0;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < k; i++) max += a[i];
  for (i = 0; i < n - k; i++) {
    if (a[i + k] > a[i]) {
      max += a[i + k] - a[i];
      num = i + 1;
    }
  }
  for (i = num; i < k + num; i++) {
    ans += (a[i] + a[i] * (a[i] - 1) / 2) * (double)(1.0 / a[i]);
  }
  printf("%lf", ans);
}
