n,k=list(map(int,input().split()))

p=list(map(int,input().split()))

p=[pp+1 for pp in p]

ans=sum(p[0:k])

last=ans

for i in range(n-k):

  tmp=last-p[i]+p[i+k]

  ans=max(ans,tmp)

  last=tmp



ans/=2

print(ans)
n,k,*a=list(map(int,open(0).read().split()))

b=[q+1 for q in a]

ans=sum(b[:k])

now=ans

for i in range(k,n):

  now=now+b[i]-b[i-k]

  ans=max(ans,now)

print((ans/2))
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
p = [pp + 1 for pp in p]
ans = sum(p[0:k])
last = ans
for i in range(n - k):
    tmp = last - p[i] + p[i + k]
    ans = max(ans, tmp)
    last = tmp
ans /= 2
print(ans)

n, k, *a = list(map(int, open(0).read().split()))
b = [q + 1 for q in a]
ans = sum(b[:k])
now = ans
for i in range(k, n):
    now = now + b[i] - b[i - k]
    ans = max(ans, now)
print((ans / 2))

-n, k = list(map(int, input().split())) -p = list(map(int, input().split())) -p = [pp + 1 for pp in p] -ans = sum(p[0:k]) -last = ans -for i in range(n - k): -    tmp = last - p[i] + p[i + k] -    ans = max(ans, tmp) -    last = tmp -ans /= 2 -print(ans) +n, k, *a = list(map(int, open(0).read().split())) +b = [q + 1 for q in a] +ans = sum(b[:k]) +now = ans +for i in range(k, n): +    now = now + b[i] - b[i - k] +    ans = max(ans, now) +print((ans / 2))