#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  double sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < k; i++) {
    sum += arr[i];
  }
  int sp = 0, ep = k;
  long long int next_sum = sum;
  while (ep != n) {
    next_sum = next_sum + arr[ep] - arr[sp];
    sum += next_sum;
    sp++;
    ep++;
  }
  float ans = (float)sum / (n - k + 1);
  printf("%0.10f", ans);
  return 0;
}
