#include <bits/stdc++.h>
using namespace std;
int a[200010];
long long int sum[200010];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  int count = n - k + 1;
  long long int s = 0;
  for (int i = 1; i <= n - k + 1; i++) {
    s += (sum[i + k - 1] - sum[i - 1]);
  }
  printf("%.10lf\n", (s * 1.0) / (count * 1.0));
  return 0;
}
