import itertools



N, K=list(map(int, input().split()))

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

acup=list(itertools.accumulate([(x+1)/2 for x in p]))

ans=acup[K-1]

for i in range(K, N):

    ans=max(ans, acup[i]-acup[i-K])

print(ans)
N, K = list(map(int, input().split()))

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



exp = [(1+p[i])/2 for i in range(N)]

s = sum(exp[:K])

ans = s

for i in range(K, N):

    s -= exp[i-K]

    s += exp[i]

    ans = max(ans, s)

print(ans)
import itertools

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
acup = list(itertools.accumulate([(x + 1) / 2 for x in p]))
ans = acup[K - 1]
for i in range(K, N):
    ans = max(ans, acup[i] - acup[i - K])
print(ans)

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
exp = [(1 + p[i]) / 2 for i in range(N)]
s = sum(exp[:K])
ans = s
for i in range(K, N):
    s -= exp[i - K]
    s += exp[i]
    ans = max(ans, s)
print(ans)

-import itertools - -acup = list(itertools.accumulate([(x + 1) / 2 for x in p])) -ans = acup[K - 1] +exp = [(1 + p[i]) / 2 for i in range(N)] +s = sum(exp[:K]) +ans = s -    ans = max(ans, acup[i] - acup[i - K]) +    s -= exp[i - K] +    s += exp[i] +    ans = max(ans, s)