#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  double general_sum, sum;
  general_sum = sum = 0;
  int i = 0;
  int j = 0;
  cin >> n >> k;
  vector<int> a(n);
  double w = n - k + 1;
  for (i; i < w; i++) {
    if (i == 0) {
      for (j; j < k; j++) {
        cin >> a[j];
        sum += a[j];
      }
    } else {
      cin >> a[j];
      sum += a[j];
      sum -= a[i - 1];
      j++;
    }
    general_sum += sum;
  }
  cout.precision(6);
  cout << fixed << general_sum / w << endl;
  return 0;
}
