#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int n, k;
long long x, sum[MAXN];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    sum[i] = sum[i - 1] + x;
  }
  long long ans = 0, p = k;
  while (p <= n) {
    ans += sum[p] - sum[p - k];
    p++;
  }
  printf("%.8lf\n", (double)(ans * 1.0 / (n - k + 1)));
  return 0;
}
