"use strict"

function func(val){
  return (1+val)/2;
}

function Main(input) {
  input = input.trim().split('\n');
  const N = input[0].trim().split(' ').map(Number)[0];
  const K = input[0].trim().split(' ').map(Number)[1];
  const p = input[1].trim().split(' ').map(Number);

  let arr = [0];
  for(let i=0; i<N; i++){
    arr.push(func(p[i]) + arr[i]);
  }

  let ret = 0;
  const max = N - K;
  for(let i=0; i<=max; i++){
    let tmp = arr[i+K] - arr[i];
    if(ret < tmp) ret = tmp
  }
  console.log(ret);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));