import numpy as np



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

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

exp_val = [(l+1)/2 for l in lst]



cumsum = np.cumsum(exp_val)



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

    if i==k-1:

        val = cumsum[i]

    else:

        val = max(val, cumsum[i] - cumsum[i-k])

print(val)
import numpy as np

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

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

cs = []

for x in p:

    cs.append(((x+1)*x//2)/x)

cs = [0]+np.cumsum(cs).tolist()

ans = 0

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

    ans = max(ans, cs[i]-cs[i-k])

print(ans)
import numpy as np

n, k = list(map(int, input().split()))
lst = list(map(int, input().split()))
exp_val = [(l + 1) / 2 for l in lst]
cumsum = np.cumsum(exp_val)
for i in range(k - 1, n):
    if i == k - 1:
        val = cumsum[i]
    else:
        val = max(val, cumsum[i] - cumsum[i - k])
print(val)

import numpy as np

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
cs = []
for x in p:
    cs.append(((x + 1) * x // 2) / x)
cs = [0] + np.cumsum(cs).tolist()
ans = 0
for i in range(k, n + 1):
    ans = max(ans, cs[i] - cs[i - k])
print(ans)

-lst = list(map(int, input().split())) -exp_val = [(l + 1) / 2 for l in lst] -cumsum = np.cumsum(exp_val) -for i in range(k - 1, n): -    if i == k - 1: -        val = cumsum[i] -    else: -        val = max(val, cumsum[i] - cumsum[i - k]) -print(val) +p = list(map(int, input().split())) +cs = [] +for x in p: +    cs.append(((x + 1) * x // 2) / x) +cs = [0] + np.cumsum(cs).tolist() +ans = 0 +for i in range(k, n + 1): +    ans = max(ans, cs[i] - cs[i - k]) +print(ans)