#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
   int n, k;
   cin>>n>>k;
   vector<int> p(n);
   rep(i, n) cin>>p[i];

   vector<int> ki2(n);
   rep(i, n) ki2[i]=(p[i]+1);

   int sum=0;
   rep(i, k) sum+=ki2[i];
   int mx=0;
   for(int i=0; i+k-1<n; i++){
      mx=max(mx, sum);
      if(i+k<n) sum+= -ki2[i] +ki2[i+k];
   }

   double ans=(double)mx/2;
   cout<<std::setprecision(15)<<ans<<endl;
   return 0;
}

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <cmath>

int main(void){
    int N;
    double ans=0;
    std::cin >> N;
    std::vector<int> P(N);
    std::vector<std::vector<int>> C(N, std::vector<int>(2));
    for (int i = 0; i < N; ++i){
        std::cin >> C[i][0] >> C[i][1];
        P.at(i) = i;
    }

    do {
        for (int i = 0; i < N - 1; ++i){
            ans += std::sqrt((C[P[i + 1]][0] - C[P[i]][0])*(C[P[i + 1]][0] - C[P[i]][0]) + (C[P[i + 1]][1] - C[P[i]][1])*(C[P[i + 1]][1] - C[P[i]][1]));
        }
    } while (std::next_permutation(P.begin(), P.end()));

    for(int i = 2; i <= N; ++i){
        ans /= i;
    }

    std::cout << std::fixed << std::setprecision(10) << ans << std::endl;

    return 0;
}