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

E = list([(x + 1) * 0.5 for x in list(map(int, input().split()))])

esum = sum(E[:k])

ans = esum

for i in range(n - k):

    esum = esum - E[i] + E[i + k]

    ans = max(ans, esum)

print(ans)

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

E = list([(x + 1) * 0.5 for x in list(map(int, input().split()))])

e = sum(E[:k])

emax = e

for i in range(k, n):

    e += E[i] - E[i - k]

    emax = max(e, emax)

print(emax)

n, k = list(map(int, input().split()))
E = list([(x + 1) * 0.5 for x in list(map(int, input().split()))])
esum = sum(E[:k])
ans = esum
for i in range(n - k):
    esum = esum - E[i] + E[i + k]
    ans = max(ans, esum)
print(ans)

n, k = list(map(int, input().split()))
E = list([(x + 1) * 0.5 for x in list(map(int, input().split()))])
e = sum(E[:k])
emax = e
for i in range(k, n):
    e += E[i] - E[i - k]
    emax = max(e, emax)
print(emax)

-esum = sum(E[:k]) -ans = esum -for i in range(n - k): -    esum = esum - E[i] + E[i + k] -    ans = max(ans, esum) -print(ans) +e = sum(E[:k]) +emax = e +for i in range(k, n): +    e += E[i] - E[i - k] +    emax = max(e, emax) +print(emax)