#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  double temp = 0, total = 0;
  double weeks = (n - k + 1);
  int i = 0, j = 0;
  while (j < k) {
    temp += a[j++];
  }
  total += temp;
  while (j < n) {
    temp -= a[i++];
    temp += a[j++];
    total += temp;
  }
  cout << fixed << setprecision(10) << (total / weeks) << endl;
  return 0;
}
