function Main(input){
    const arr = input.split('\n');
    const [N, K] = arr[0].split(' ').map(Number);
    const pi = arr[1].split(' ').map(Number);
    let maxNum = 0;
    let Knum = 0;
    let answer = 0;
    for(let i=0; i<K; i++){
        Knum += pi[i];
    }
    maxNum = Knum;
    for(let i=K; i<pi.length; i++){
        Knum += pi[i]-pi[i-K];
        if(maxNum < Knum)  maxNum = Knum;
    }
    const answer = (maxNum+K)/2;
    console.log(answer);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());