#include <bits/stdc++.h>
using namespace std;
int a[200000];
double f[200000];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  f[0] = a[0];
  for (int i = 1; i < n; i++) {
    f[i] = f[i - 1] + a[i];
  }
  double sum = f[k - 1];
  for (int i = 1, j = i + k - 1; i + k - 1 < n && j < n; i++, j++) {
    sum += f[j] - f[i - 1];
  }
  printf("%lf\n", sum / (n - k + 1));
  return 0;
}
