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

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



ans = [0] * n

for i in range(n):

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



ruiseki = [0] * (n + 1)

for i in range(n):

    ruiseki[i + 1] = ruiseki[i] + ans[i]

    

res = 0

for i in range(n):

    if k+i > n:

        break

    res = max(res, ruiseki[k + i] - ruiseki[i])

print(res)

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

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



sum_ = sum(p[0:k])

max_ = sum(p[0:k])

for i in range(k, n):

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

    max_ = max(sum_, max_)



print(((max_ + k) / 2))
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
    ans[i] = (p[i] + 1) / 2
ruiseki = [0] * (n + 1)
for i in range(n):
    ruiseki[i + 1] = ruiseki[i] + ans[i]
res = 0
for i in range(n):
    if k + i > n:
        break
    res = max(res, ruiseki[k + i] - ruiseki[i])
print(res)

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

-ans = [0] * n -for i in range(n): -    ans[i] = (p[i] + 1) / 2 -ruiseki = [0] * (n + 1) -for i in range(n): -    ruiseki[i + 1] = ruiseki[i] + ans[i] -res = 0 -for i in range(n): -    if k + i > n: -        break -    res = max(res, ruiseki[k + i] - ruiseki[i]) -print(res) +sum_ = sum(p[0:k]) +max_ = sum(p[0:k]) +for i in range(k, n): +    sum_ += p[i] - p[i - k] +    max_ = max(sum_, max_) +print(((max_ + k) / 2))