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