#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int a[maxn];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long ans = 0, zz = 0, cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (i > k) ans += zz, zz -= a[i - k], cnt++;
    zz += a[i];
  }
  ans += zz, cnt++;
  double ww = (double)ans / (double)cnt;
  printf("%.10lf\n", ww);
  return 0;
}
