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

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



kitaiti = [0 for _ in range(n)]

ruisekiwa = [0 for _ in range(n)]

r = k - 1

max = 0

now = 0

ans_list = []



for i in range(n):

    kitaiti[i] = (p[i]+1) / 2

    if i == 0:

        ruisekiwa[0] = kitaiti[0]

    else:

        ruisekiwa[i] = ruisekiwa[i-1] + kitaiti[i]

    if i == r:

        now = ruisekiwa[i]

    elif i > r:

        now = ruisekiwa[i] - ruisekiwa[i-r-1]

    if now > max:

        max = now

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

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

now = sum(p[:k])

ans = (now + k) / 2

for i in range(k, n):

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

    ans = max(ans, (now + k) / 2)

print(ans)
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
kitaiti = [0 for _ in range(n)]
ruisekiwa = [0 for _ in range(n)]
r = k - 1
max = 0
now = 0
ans_list = []
for i in range(n):
    kitaiti[i] = (p[i] + 1) / 2
    if i == 0:
        ruisekiwa[0] = kitaiti[0]
    else:
        ruisekiwa[i] = ruisekiwa[i - 1] + kitaiti[i]
    if i == r:
        now = ruisekiwa[i]
    elif i > r:
        now = ruisekiwa[i] - ruisekiwa[i - r - 1]
    if now > max:
        max = now
print(max)

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

-kitaiti = [0 for _ in range(n)] -ruisekiwa = [0 for _ in range(n)] -r = k - 1 -max = 0 -now = 0 -ans_list = [] -for i in range(n): -    kitaiti[i] = (p[i] + 1) / 2 -    if i == 0: -        ruisekiwa[0] = kitaiti[0] -    else: -        ruisekiwa[i] = ruisekiwa[i - 1] + kitaiti[i] -    if i == r: -        now = ruisekiwa[i] -    elif i > r: -        now = ruisekiwa[i] - ruisekiwa[i - r - 1] -    if now > max: -        max = now -print(max) +now = sum(p[:k]) +ans = (now + k) / 2 +for i in range(k, n): +    now += p[i] - p[i - k] +    ans = max(ans, (now + k) / 2) +print(ans)