#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(8);
  int n, l;
  cin >> n >> l;
  long double m = n - l + 1;
  int pihu = n - l + 1;
  long double sum[n + 1];
  long double sumtill[n + 1];
  long double answala, ans = 0;
  sumtill[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> sum[i];
    sumtill[i] = sumtill[i - 1] + sum[i];
  }
  for (int i = 1; i <= pihu; i++) {
    ans += sumtill[i + l - 1] - sumtill[i - 1];
  }
  answala = ans / m;
  cout << answala;
}
