#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long sum = 0, i, m, p;
  float total, temp, n, k;
  vector<long long> v1;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> m;
    v1.push_back(m);
    if (i <= k - 1) sum = sum + v1[i];
  }
  i = 0;
  total = sum;
  p = k;
  while (k <= n - 1) {
    sum = abs(sum - v1[i]) + v1[k];
    total = total + sum;
    i++;
    k++;
  }
  temp = n - p + 1;
  cout << fixed << setprecision(8) << total / temp;
}
int main() {
  solve();
  return 0;
}
