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

p = [(int(i)+1.0)/2.0 for i in input().split()]

ans = 0

for i in range(k):

    ans += p[i]

tmp1 = ans

for i in range(k, n):

    tmp2 = (tmp1 - p[i-k])+p[i]

    ans = max(ans, tmp2)

    tmp1 = tmp2

print(('{:.12f}'.format(ans)))

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

p = [(int(i)+1.0)/2.0 for i in input().split()]

ans = tmp = sum(p[:k])

for i in range(k,n):

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

    ans = max(ans, tmp)

print(('{:.12f}'.format(ans)))

n, k = list(map(int, input().split()))
p = [(int(i) + 1.0) / 2.0 for i in input().split()]
ans = 0
for i in range(k):
    ans += p[i]
tmp1 = ans
for i in range(k, n):
    tmp2 = (tmp1 - p[i - k]) + p[i]
    ans = max(ans, tmp2)
    tmp1 = tmp2
print(("{:.12f}".format(ans)))

n, k = list(map(int, input().split()))
p = [(int(i) + 1.0) / 2.0 for i in input().split()]
ans = tmp = sum(p[:k])
for i in range(k, n):
    tmp += p[i] - p[i - k]
    ans = max(ans, tmp)
print(("{:.12f}".format(ans)))

-ans = 0 -for i in range(k): -    ans += p[i] -tmp1 = ans +ans = tmp = sum(p[:k]) -    tmp2 = (tmp1 - p[i - k]) + p[i] -    ans = max(ans, tmp2) -    tmp1 = tmp2 +    tmp += p[i] - p[i - k] +    ans = max(ans, tmp)