#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5;
int v[MAXN];
long long s[MAXN];
int main() {
  double average = 0;
  int tot = 0;
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]);
  for (int i = 1; i <= n; i++) s[i] = v[i] + s[i - 1];
  for (int i = k; i <= n; i++) {
    average += s[i] - s[i - k];
    tot++;
  }
  printf("%.10lf\n", 1.0 * average / tot);
  return 0;
}
