#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  double a[n], sum = 0;
  double sumt;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i < k) sum += a[i];
  }
  sumt = sum;
  for (int i = 0; i < n - k; i++) {
    sum = sum + a[i + k] - a[i];
    sumt += sum;
  }
  long long precision = numeric_limits<double>::digits10;
  cout << setprecision(precision);
  double ans = double(sumt) / (double(n - k + 1));
  cout << ans << endl;
}
