#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1.0);
const int BIG = 1e9;
const long long INF = 1e18;
const int M = 2e5 + 1;
const int L = 18;
int n, k;
long long a[M], pr[M];
int main() {
  cin.sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  pr[0] = 0;
  for (int i = 0; i < n; i++) pr[i + 1] = pr[i] + a[i];
  long long s = 0;
  for (int i = 0; i <= n - k; i++) s += pr[i + k] - pr[i];
  cout << fixed << setprecision(20);
  cout << (long double)s / (n - k + 1);
  return 0;
}
