console.log((args=>{
  const [[N,K],p] = args.trim().split`\n`.map(r=>r.split` `.map(v=>0|v));
  const s = [0];
  for ( let i = 0; i < N; i++ ) s.push( s[i] + p[i] + 1 );
  let max = 0;
  for ( let i = 0; i + K <= N; i++ ) if ( max < s[i+K] - s[i] ) max = s[i+K] - s[i];
  return `${max/2}`;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
