#include <bits/stdc++.h>
using namespace std;
bool srt(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.second == b.second)
    return (a.first <= b.first);
  else
    return (a.second <= b.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int a, b, n, j = 0, k = 0, q = 0, x = 0, y, c = 0, d, p, nl, np,
                         m = 1, ans = 0;
  cin >> n >> m;
  j = n - m + 1;
  vector<long long int> v(n + 1, 0);
  for (long long int i = 1; i <= n; i++) {
    cin >> x;
    v[i] += v[i - 1] + x;
  }
  for (long long int i = m; i <= n; i++) {
    c += v[i] - v[i - m];
  }
  float a11 = 0;
  a11 = 1.0 * c / j;
  cout << setprecision(7) << a11 << " ";
  cout << "\n";
  return 0;
}
