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