#include <bits/stdc++.h>
int n, k, a;
long long int ans, al[(int)2e5 + 5];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a);
    al[i] = a + al[i - 1] * (!!i);
  }
  ans = al[k - 1];
  for (int i = 1; i + k - 1 < n; ++i) {
    ans += (al[i + k - 1] - al[i - 1]);
  }
  printf("%lf\n", ans / (double)(n - k + 1));
  return 0;
}
