"use strict";

const main = arg => {
    // 標準入力の不要な空白と改行を削除し、配列に格納する
    const input = arg.trim().split("\n");
    const N = parseInt(input[0].split(" ")[0],10);
    const K = parseInt(input[0].split(" ")[1],10);
    const pArray = input[1].split(" ").map(n => parseInt(n,10));

    const kitaichi = i => (i + 1) / 2;
    const kitaichiArray = pArray.map(p => kitaichi(p));

	const cumulativeSum = (array) => {
		let arr = [0];
		array.reduce((a, i) => {
			a === 0 ? arr.push(i) : arr.push(a + i);
			return a + i
		}, 0)
		return arr;
	}

	const cumulativeSumArray = cumulativeSum(kitaichiArray);
	
    let answer = 0;
    for (let i=K; i<N+1; i++) {
        if (answer < (cumulativeSumArray[i] - cumulativeSumArray[i-K])) {
            answer = (cumulativeSumArray[i] - cumulativeSumArray[i-K]);
        } else {
            return;
        }
    }

	console.log(answer);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));  