#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
const int N = (int)1e5 + 5;
const long long oo = (long long)1e18 + 9;
const int mod = (int)1e9 + 7;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
long long gcd(long long a, long long b) {
  (a < 0) ? a = -a : 1;
  (b < 0) ? b = -b : 1;
  return !b ? a : gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long power(long long a, long long b, long long ret = 1LL) {
  while (b--) ret = (ret * a);
  return ret;
}
void INPUT() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
long long a[N * 2], prfx[N * 2], n, k, sum;
int main() {
  INPUT();
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    prfx[i] = prfx[i - 1] + a[i];
  }
  for (int i = k; i <= n; i++) sum += (prfx[i] - prfx[i - k]);
  cout << fixed << setprecision(15) << 1.0 * sum / (n - k + 1);
  return 0;
}
