function Main(input){
  input=input.split("\n");
  input[0]=input[0].split(" ");
  var saikoroNum = parseInt(input[0][0],10);
  var rinsetsu = parseInt(input[0][1],10);
  var tokuten = input[1].split(" ").map(Number);
  var highest = 0;
  for(var n = 0; n < saikoroNum-rinsetsu+1; n++){
    var val = 0;
    for(var m = 0; m < rinsetsu; m++){
      val += tokuten[n+m];
    }
    if(highest<val){
      highest = val;
    }
  }
  console.log((highest+rinsetsu)/2);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));