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