#include <bits/stdc++.h>
using namespace std;
long long ceil(long long x, long long y) {
  if (x % y)
    return x / y + 1;
  else
    return x / y;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long n, k, sum = 0;
  cin >> n >> k;
  vector<long long> vec;
  for (long long i = 0; i < n; i++) {
    long long num;
    cin >> num;
    vec.push_back(num);
    if (i < k) sum += num;
  }
  long long cnt = n - k + 1, total = sum, j = 0;
  for (long long i = k; i < n; i++) {
    sum -= vec[j];
    j++;
    sum += vec[i];
    total += sum;
  }
  double p = double(total) / (double)cnt;
  cout << setprecision(12) << fixed;
  cout << p << endl;
}
