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

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

dd = [0] * (n + 1)

for i in range(1, n + 1):

    dd[i] = dd[i - 1] + p[i - 1]

total = 0

index = 0

j = 0

while j < n + 1:

    if j + k >= n + 1:

        break

    now = dd[j + k] - dd[j]

    if now > total:

        total = now

        index = j

    j += 1

ans = 0

for i in range(k):

    aa = index + i

    ans += p[index + i] + 1

ans /= 2

print(ans)

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

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

ans = 0

now = sum(p[:k-1])

for i in range(n - k + 1):

    now += p[i + k - 1]

    if now > ans:

        ans = now

    now -= p[i]

ans += k

ans /= 2

print(ans)

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
dd = [0] * (n + 1)
for i in range(1, n + 1):
    dd[i] = dd[i - 1] + p[i - 1]
total = 0
index = 0
j = 0
while j < n + 1:
    if j + k >= n + 1:
        break
    now = dd[j + k] - dd[j]
    if now > total:
        total = now
        index = j
    j += 1
ans = 0
for i in range(k):
    aa = index + i
    ans += p[index + i] + 1
ans /= 2
print(ans)

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

-dd = [0] * (n + 1) -for i in range(1, n + 1): -    dd[i] = dd[i - 1] + p[i - 1] -total = 0 -index = 0 -j = 0 -while j < n + 1: -    if j + k >= n + 1: -        break -    now = dd[j + k] - dd[j] -    if now > total: -        total = now -        index = j -    j += 1 -for i in range(k): -    aa = index + i -    ans += p[index + i] + 1 +now = sum(p[: k - 1]) +for i in range(n - k + 1): +    now += p[i + k - 1] +    if now > ans: +        ans = now +    now -= p[i] +ans += k