#include <bits/stdc++.h>
using namespace std;
int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1};
int ini() {
  int x;
  scanf("%d", &x);
  return x;
}
long long inl() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const int N = (int)2e5 + 5;
const int INF = (int)1e9 + 7;
long long ps[N];
int main() {
  long long n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    ps[i] = ps[i - 1] + x;
  }
  long long res = 0;
  for (int i = k; i <= n; i++) {
    long long s = ps[i] - ps[i - k];
    res += s;
  }
  double r = (double)res / (double)(n - k + 1);
  printf("%.8f\n", r);
  return 0;
}
