#include<vector>
#include<iostream>
#include<algorithm>
#include<unordered_map>
#include<list>
#include<stack>
#include<functional>
#include<set>
#include<bitset>
#include<map>
#include<iomanip>

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
const ll MOD = 1000000007;

ll mypow(ll x,ll n){
    ll ret = 1;
    while(n > 0){
        if(n&1){
            ret *= x;
        }
        n >>= 1;
        x *= x;
    }
    return ret;
}

int solve(int n){
    vector<int> input(n);
    for(int i = 0; i < n; i++){
        cin >> input[i];
    }
    int ans = 0;
    for(int i = 0; i < n; i++){
        ans = max(ans,input[i]);
    }
    return ans;
}

// 1-based indexing
template<class valType>
class SegmentTree{
    vector<valType> node;
    valType initialVal;
    size_t treeSize;
    size_t dataSize;

    function<valType(valType,valType)> addFunc,extFunc;

    pair<int,int> getMaxBit(int x){
        int i = 1;
        int j = 2;
        while(j < x){
            j *= 2;
            ++i;
        }
        return {j,i};
    }

    void classInitialize(){
        treeSize = getMaxBit(dataSize).first;
        node = vector<valType>(treeSize*2+1,initialVal);
    }

public:

    SegmentTree(int size,valType init):dataSize(size),initialVal(init){
        addFunc = [](valType a,valType b)->valType{
            return a + b;
        };

        extFunc = [](valType a,valType b)->valType{
            return a + b;
        };

        classInitialize();
    }

    SegmentTree(int size,valType init,function<valType(valType,valType)> func):dataSize(size),initialVal(init),extFunc(func){
        addFunc = [](valType a,valType b)->valType{
            return a+b;
        };
        classInitialize();
    }

    SegmentTree(int size,valType init,function<valType(valType,valType)> add,function<valType(valType,valType)> ext):dataSize(size),initialVal(init),extFunc(ext){
        classInitialize();
    }

    void initAll(const vector<valType> &vec){
        for(int i = 0; i < dataSize; i++){
            node[i + treeSize] = vec[i];
        }

        int idx = treeSize/2;
        while(idx > 0){
            for(int i = idx; i < idx*2; i++){
                node[i] = extFunc(node[i*2],node[i*2 + 1]);
            }
            --idx;
        }
    }

    void update(int idx){
        int nodeIdx = (treeSize + idx - 1)/2;
        while(nodeIdx > 0){
            node[nodeIdx] = extFunc(node[nodeIdx*2],node[nodeIdx*2+1]);
        }
    }

    void add(int idx,valType v){
        node[idx + treeSize - 1] = addFunc(node[idx + treeSize - 1],v);
        update(idx);
    }

    void insert(int idx,valType v){
        node[idx + treeSize - 1] = v;
        update(idx);
    }

    valType get(int l,int r){
        if(l > r || l <= 0 || r > treeSize){
            return initialVal;
        }

        int lIdx = l + treeSize - 1;
        int rIdx = r + treeSize - 1;

        valType lVal = node[lIdx];
        valType rVal = node[rIdx];

        if(lIdx == rIdx){
            return lVal;
        }

        while(lIdx > 0 && rIdx > 0){
            int lNext = lIdx/2;
            int rNext = rIdx/2;

            if(lNext == rNext){
                return extFunc(lVal,rVal);
            }

            if(lIdx % 2 == 0){
                lVal = extFunc(lVal,node[lNext*2 + 1]);
            }

            if(rIdx % 2 == 1){
                rVal = extFunc(rVal,node[rNext*2]);
            }

            lIdx = lNext;
            rIdx = rNext;
        }

        return initialVal;
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N,K;
    cin >> N >> K;

    vector<ll> p(N);
    for(auto &x : p){
        cin >> x;
    }

    vector<double> expectedValue(N);
    for(int i = 0; i < N; i++){
        expectedValue[i] = (double)((p[i]*(p[i] + 1))/2)/(double)p[i];
    }

    vector<double> totalSum(N+1,0);
    for(int i = 1; i <= N; i++){
        totalSum[i] = totalSum[i-1] + expectedValue[i-1];
    }

    double ans = 0;
    for(int i = K; i <= N; i++){
        ans = max(ans,totalSum[i] - totalSum[i-K]);
    }

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

    return 0;
}

Measured memory_bytes: 4992