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