#include <bits/stdc++.h>
using namespace std;
long long n, k;
double arr[200000 + 5], cmsum[200000 + 5];
int main() {
  cin >> n >> k;
  double sum = 0, x = n - k + 1;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    cmsum[i] += cmsum[i - 1] + arr[i];
  }
  long long j = k;
  for (int i = 0; i < n - k + 1; i++) {
    sum += cmsum[j] - cmsum[i];
    j++;
  }
  cout << fixed << setprecision(12) << sum / x << endl;
  return 0;
}
