#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  while (cin >> n >> k) {
    int a[200005] = {0};
    long long int sum[200005] = {0};
    for (int i = 1; i <= n; i++) cin >> a[i];
    sum[0] = 0;
    for (int i = 1; i <= n; i++) sum[i] = a[i] + sum[i - 1];
    int tmp = n - k + 1;
    long long int ssum = 0;
    for (int i = tmp; i <= n; i++) ssum += sum[i] - sum[i - tmp];
    printf("%.10lf\n", ssum * 1.0 / tmp);
  }
}
