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