#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans = 0, aa, s = 0, a[200005], i, j, k, nn = 0, l,
               m = 82727377373;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < k; i++) s += a[i];
  ans = s;
  for (i = k; i < n; i++) {
    s += a[i] - a[i - k];
    ans += s;
  }
  printf("%0.10lf", (double)ans / (n - k + 1));
}
