#include <bits/stdc++.h>
using namespace std;
int v[200001];
int main() {
  int n, k, i;
  long long s = 0;
  double avr = 0;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; i++) scanf("%d", &v[i]);
  for (i = 1; i <= k; i++) s += v[i];
  avr += s;
  for (i = k + 1; i <= n; i++) {
    s = s - v[i - k] + v[i];
    avr += s;
  }
  printf("%.6f", avr / (n - k + 1));
  return 0;
}
