#include <bits/stdc++.h>
using namespace std;
double a[200005];
double qs[200005];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf(" %lf", a + i);
    qs[i] = qs[i - 1] + a[i];
  }
  double ans = 0.0000000000;
  for (int i = k; i <= n; ++i) {
    ans += qs[i] - qs[i - k];
  }
  ans /= (double)(n - k + 1);
  printf("%.17f\n", ans);
  return 0;
}
