#include <bits/stdc++.h>
using namespace std;
#define all(n) begin(n), end(n)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts)
{
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
int main()
{
    int N,K;
    cin>>N>>K;
    vector<long double> p(N),psum(N);
    for (size_t i = 0; i < N; i++)
    {
        long double q;
        cin>>q;
        p[i]=(q+(long double)1)/(long double)2;
    }
    partial_sum(all(p),psum.begin());
    long double ans = psum[K-1];
    for (size_t i = 0; i+K < N; i++)
    {
        chmax(ans,psum[i+K]-psum[i]);
    }
    cout<<setprecision(30)<<ans<<endl;
    return 0;
}
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;
#define REP(i,n) for (int i = 0; i <(n); ++i)
//debug 
#ifdef _DEBUG
#define debug(var)  do{cout << #var << " :";view(var);}while(0)
#else
#define debug(...)
#endif
template<typename T> void view(T e){cout << e << endl;}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }


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

  //
  
  int ex = 0;
  //前処理
  REP(i,k){
    int px = p[i]+1;
    ex += px;
  }
  int exmax = ex;

  REP2(i,k,n){
    ex -= p[i-k];
    ex += p[i];
    exmax = max(ex,exmax);
  }

  double ans = (double)exmax/2;

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

  return 0;
}