#include <bits/stdc++.h>
using namespace std;
long long stringtoll(string xx) {
  stringstream ss;
  ss << xx;
  long long val;
  ss >> val;
  return val;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  long long a[n + 1], pre[n + 1];
  pre[0] = 0;
  for (int i = 1; i <= (n); i++) {
    cin >> a[i];
    if (i == 1)
      pre[i] = a[i];
    else
      pre[i] = pre[i - 1] + a[i];
  }
  long long sum = 0;
  for (int i = 1; i <= (n - k + 1); i++) {
    sum += (pre[i + k - 1] - pre[i - 1]);
  }
  double xx = (double)sum / (double)(n - k + 1);
  cout << setprecision(15) << xx << endl;
}
