"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const K = parseInt(arg[0].split(" ")[1]);
    const p = arg[1].split(" ").map(n=>parseInt(n));
    
    // 期待値はpが大きいほど大きくなる
    // 最後に計算すれば良い
    
    const map = {};
    
    let totalSum = new Array(N).fill(0);
    
    // 累積和
    for(let i=0; i<N; i++) {
        totalSum[parseInt(i) + 1] = totalSum[i] + p[i];
    }

    let answer = 0;
    let index  = 0;
    
    // console.log(totalSum)
    
    // Kの範囲で大きくなってるとこ探す
    for(let i=K; i<=N; i++) {
        const temp = totalSum[i] - totalSum[i - K];
        
        // console.log("i" + totalSum[i]);
        // console.log("i - K" + totalSum[i - K]);
        // console.log(temp)
        
        if(answer < temp) {
            answer = temp;
            index  = i - K;
        } 
    }
    
    let expectation = 0;
    
    // 期待値を計算
    for(let i=index; i<index + K; i++) {
        expectation += ((0.5 * p[i]) * (p[i] + 1)) / p[i];
    }
    
    console.log(expectation);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));