"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 num = 0;
  let trg;
  for(let i=0; i<=max; i++){
    let tmp = p.slice(i, K+i);
    let q = tmp.reduce((a, b) => a+=b);
    if(q > num){
      num = q;
      trg = tmp;
    }
  }

  let ret = 0;
  trg.forEach(el => {
    ret += func(el) / el;
  })

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