#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1e5 + 5;
long long sum[maxn];
int main() {
  sum[0] = 0;
  int n, k;
  long long x;
  double ans = 0;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &x);
    sum[i] += sum[i - 1] + x;
  }
  int len = n - k + 1;
  for (int R = len, L = 1; R <= n; R++, L++)
    ans += (sum[R] - sum[L - 1]) * 1.0 / len;
  printf("%.10lf", ans);
  return 0;
}
