#include <bits/stdc++.h>
using namespace std;
long long A[200005];
int main() {
  int N, K;
  scanf("%d %d", &N, &K);
  for (int i = 1; i <= N; i++) {
    scanf("%lld", &A[i]);
    A[i] += A[i - 1];
  }
  long long ans = 0;
  for (int i = K; i <= N; i++) ans += A[i] - A[i - K];
  cout << fixed << setprecision(9) << (long double)ans / (N - K + 1) << "\n";
  return 0;
}
