#include <bits/stdc++.h>
using namespace std;
double k, tot, tot1, tambah, ans, jaw, a, x, y, week;
int n, i, A[1000000], j;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> A[i];
  }
  j = 1;
  for (i = 1; i <= n; i++) {
    tot += A[i];
    if (i >= k) {
      ans += tot;
      tot -= A[j];
      j++;
    }
  }
  week = n - k + 1;
  jaw = ans / week;
  cout << fixed << setprecision(12) << jaw << "\n";
}
