#include <bits/stdc++.h>
using namespace std;
void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  io();
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  long double avg_present_week = 0;
  long double avg = 0;
  for (int i = 0; i < k; i++) avg_present_week += arr[i];
  avg = avg_present_week;
  for (int i = k; i < n; i++) {
    avg_present_week = (avg_present_week - arr[i - k] + arr[i]);
    avg += avg_present_week;
  }
  cout << fixed;
  cout << setprecision(15) << (avg / (double)(n - k + 1)) << endl;
}
