#include <bits/stdc++.h>
using namespace std;
long long sum[2000005];
int main() {
  long long n;
  double k;
  cin >> n >> k;
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + v[i - 1];
  }
  double total = 0;
  int go = n - k + 1;
  for (int i = 0; i < v.size(); i++) {
    if (go + i - 1 == v.size()) {
      break;
    }
    total += (sum[go + i] - sum[i]) / (double)go;
  }
  printf("%.10llf\n", total);
}
