#include <bits/stdc++.h>
using namespace std;
long long int ara[200010] = {0};
int main() {
  long long int n, k, sum = 0, num;
  cin >> n >> k;
  num = (n - k + 1);
  ara[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> ara[i];
  }
  for (int i = 1; i <= n; i++) {
    ara[i] += ara[i - 1];
    if (i >= k) {
      sum += ara[i] - ara[i - k];
    }
  }
  cout << setprecision(8) << (1.0 * sum / num);
  return 0;
}
