#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, k, i;
double sum;
long long temp, a[N];
int main() {
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; ++i)
    scanf("%d", a + i), a[i] = !i ? a[i] : a[i] + a[i - 1];
  for (i = 0; i + k <= n; ++i) {
    sum += (a[i + k - 1] - temp);
    temp = a[i];
  }
  printf("%.9lf\n", sum / (double)(n - k + 1));
  return 0;
}
