"use strict"

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

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 max = N - K;
  let ret = 0;
  for(let i=0; i<=max; i++){
    let tmp = p.slice(i, K+i);
    let cnt = 0;
    for(let j=0; j<K; j++){
      let s = tmp[j];
      let expect = func(s) / s;
      cnt += expect;
    }

    if(ret < cnt) ret = cnt;
  }

  console.log(ret);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));