from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque

n,k = [int(x) for x in stdin.readline().rstrip().split()]
p = [(int(x)+1)/2 for x in stdin.readline().rstrip().split()]

m = sum(p[0:k])
maxm = m

for i in range(1,n-k+1):
    m = m - p[i-1] + p[i+k-1]
    maxm = max([maxm,m])

print(maxm)

 from sys import stdin import sys sys import math math from functools import reduce import functools functools import itertools itertools from collections import deque int(x) for x in stdin.readline().rstrip().split() for x in stdin.readline().rstrip().split() x stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split for x in stdin.readline().rstrip().split() int(x) int x n,k = [int(x) for x in stdin.readline().rstrip().split()] n [int(x) for x in stdin.readline().rstrip().split()] k (int(x)+1)/2 for x in stdin.readline().rstrip().split() for x in stdin.readline().rstrip().split() x stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split for x in stdin.readline().rstrip().split() (int(x)+1)/2 int(x)+1 int(x) int x 1 2 p = [(int(x)+1)/2 for x in stdin.readline().rstrip().split()] p [(int(x)+1)/2 for x in stdin.readline().rstrip().split()] m = sum(p[0:k]) m sum(p[0:k]) sum p[0:k] p 0:k 0 k maxm = m maxm m for i in range(1,n-k+1):
    m = m - p[i-1] + p[i+k-1]
    maxm = max([maxm,m]) i range(1,n-k+1) range 1 n-k+1 n-k n k 1 m = m - p[i-1] + p[i+k-1] m m - p[i-1] + p[i+k-1] m - p[i-1] m p[i-1] p i-1 i 1 p[i+k-1] p i+k-1 i+k i k 1 maxm = max([maxm,m]) maxm max([maxm,m]) max [maxm,m] maxm m print(maxm) print maxm k = [int(x) for x in stdin.readline().rstrip().split()] [int(x) for x in stdin.readline().rstrip().split()] k maxm = max([maxm,m]) max([maxm,m]) maxm p = [(int(x)+1)/2 for x in stdin.readline().rstrip().split()] [(int(x)+1)/2 for x in stdin.readline().rstrip().split()] p n,k = [int(x) for x in stdin.readline().rstrip().split()] [int(x) for x in stdin.readline().rstrip().split()] n m = sum(p[0:k]) sum(p[0:k]) m m = m - p[i-1] + p[i+k-1] m - p[i-1] + p[i+k-1] m maxm = m m maxm
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque

n,k = [int(x) for x in stdin.readline().rstrip().split()]
p = [(int(x)+1)/2 for x in stdin.readline().rstrip().split()]

m = sum(p[0:k])
maxm = m

for i in range(1,n-k+1):
    m = m - p[i-1] + p[i+k-1]
    maxm = max([maxm,m])

print(maxm)


