// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <algorithm>

#include <vector>

#include <array>

#include <queue>

#include <deque>

#include <map>

#include <set>

#include <sstream>

#include <cstdio>

#include <cstring>

#include <cmath>

#include <list>

#include <numeric>

#include <stack>

#include <iomanip>

#include <random>

#include <complex>

#include <functional>

#include <tuple>

#include <new>



using namespace std;



#define EPS (1e-9)

#define INF (1e9)

#define MOD (ll)(1e9 + 7)

#define PI (acos(-1))

#define REP(i,a,n) for(int i=a;i<n;i++)

#define rep(i, n) REP(i,0,n)

#define allof(a) (a).begin(), (a).end()



#define Yes(q) ((q) ? "Yes" : "No")

#define YES(q) ((q) ? "YES" : "NO")

#define Possible(q) ((q) ? "Possible" : "Impossible")

#define POSSIBLE(q) ((q) ? "POSSIBLE" ; "IMPOSSIBLE")



using ll = long long int;



ll gcd(ll a, ll b) {

    if (a < b) swap(a, b);

    if (b == 0) return a;

    return gcd(b, a % b);

}



ll beki(ll a, ll b) {

    ll tmp = 1;

    rep(i, b) tmp *= a;

    return tmp;

}



ll modPow(ll x, ll a) {

    if (a == 1) return x;

    if (a % 2) return (x * modPow(x, a - 1)) % MOD;

    ll t = modPow(x, a / 2);

    return ((t % MOD) * (t % MOD)) % MOD;

}



ll modInv(ll x) {

    return modPow(x, MOD - 2);

}



ll K, N;

vector<long double> p(200010);

long double ans = 0, tmp = 0;



int main() {

    cin >> N >> K;

    rep(i, N) cin >> p[i];



    rep(i, K) {

        //まず最初にぶっこむ

        ans += (1 + p[i]) / 2;

        tmp += (1 + p[i]) / 2;

        //cout << (1 + p[i]) / 2 << endl;

    }



    //double tmp = ans;

    REP(i, K, N) {

        tmp -= (1 + p[i - K]) / 2;

        tmp += (1 + p[i]) / 2;

        ans = max(ans, tmp);

        //cout << ans << endl;

    }



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

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <string>

#include <algorithm>

#include <vector>

#include <array>

#include <queue>

#include <deque>

#include <map>

#include <set>

#include <sstream>

#include <cstdio>

#include <cstring>

#include <cmath>

#include <list>

#include <numeric>

#include <stack>

#include <iomanip>

#include <random>

#include <complex>

#include <functional>

#include <tuple>

#include <new>



using namespace std;



#define EPS (1e-9)

#define INF (1e9)

#define MOD (ll)(1e9 + 7)

#define PI (acos(-1))

#define REP(i,a,n) for(int i=a;i<n;i++)

#define rep(i, n) REP(i,0,n)

#define allof(a) (a).begin(), (a).end()



#define Yes(q) ((q) ? "Yes" : "No")

#define YES(q) ((q) ? "YES" : "NO")

#define Possible(q) ((q) ? "Possible" : "Impossible")

#define POSSIBLE(q) ((q) ? "POSSIBLE" ; "IMPOSSIBLE")



using ll = long long int;



ll gcd(ll a, ll b) {

    if (a < b) swap(a, b);

    if (b == 0) return a;

    return gcd(b, a % b);

}



ll beki(ll a, ll b) {

    ll tmp = 1;

    rep(i, b) tmp *= a;

    return tmp;

}



ll modPow(ll x, ll a) {

    if (a == 1) return x;

    if (a % 2) return (x * modPow(x, a - 1)) % MOD;

    ll t = modPow(x, a / 2);

    return ((t % MOD) * (t % MOD)) % MOD;

}



ll modInv(ll x) {

    return modPow(x, MOD - 2);

}



ll K, N;

vector<double> p(200010);

double ans = 0, tmp = 0;



int main() {

    cin >> N >> K;

    rep(i, N) cin >> p[i];



    rep(i, K) {

        //まず最初にぶっこむ

        ans += (1 + p[i]) / 2;

        tmp += (1 + p[i]) / 2;

        //cout << (1 + p[i]) / 2 << endl;

    }



    //double tmp = ans;

    REP(i, K, N) {

        tmp -= (1 + p[i - K]) / 2;

        tmp += (1 + p[i]) / 2;

        ans = max(ans, tmp);

        //cout << ans << endl;

    }



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

}

// Fastest known solution for this problem: