#include <bits/stdc++.h>
using namespace std;
int n, k;
double a[200005];
int main() {
  cin >> n >> k;
  double s;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    a[i] = a[i - 1] + s;
  }
  double res = 0;
  for (int i = k; i <= n; i++) {
    res = res + double(a[i] - a[i - k]) / (n - k + 1);
    int j;
  }
  std::cout.setf(std::ios::fixed, std::ios::floatfield);
  std::cout.precision(10);
  std::cout << res;
  return 0;
}
