#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, cnt = 0;
  cin >> n >> k;
  long long int sum = 0, a[n + 1];
  long long int week = n - k + 1;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < k; i++) sum += a[i];
  long long int total = sum;
  for (int i = k; i < n; i++) {
    sum += a[i];
    sum -= a[i - k];
    total += sum;
  }
  printf("%lf\n", (double)total / (double)week);
  return 0;
}
