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