#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int arr[200010];
  double sum = 0;
  double total = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i < k) {
      sum += arr[i];
    } else {
      total += sum;
      sum += arr[i] - arr[i - k];
    }
  }
  total += sum;
  printf("%9f", total / (n - k + 1));
  return 0;
}
