#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j;
  long double k, sum = 0, ans = 0;
  cin >> n >> k;
  long long int a[n];
  long double d;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < k; i++) {
    sum += a[i];
  }
  ans += sum;
  for (i = 0; i < n - k + 1; i++) {
    j = k + i;
    if (j < n) {
      sum += a[j] - a[i];
      ans += sum;
    }
  }
  long double t = n - k + 1;
  d = (long double)(ans / t);
  cout << fixed << setprecision(15) << d << endl;
}
