N,K = list(map(int,input().split()))

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

B = [0]

def f(p):

    return p*(1+p)//2/p

for i in range(N):

    B.append(B[i]+f(P[i]))

ans = 0

for i in range(K,N+1):

    ans = max(ans,B[i]-B[i-K])

print(ans)
N,K = list(map(int,input().split()))

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

ans = 0

D = [0]+[(p+1)/2 for p in P]

res = 0

for i in range(N+1):

    res += D[i]

    if i>=K:

        res-=D[i-K]

        ans = max(res,ans)

print(ans)
N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
B = [0]


def f(p):
    return p * (1 + p) // 2 / p


for i in range(N):
    B.append(B[i] + f(P[i]))
ans = 0
for i in range(K, N + 1):
    ans = max(ans, B[i] - B[i - K])
print(ans)

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
ans = 0
D = [0] + [(p + 1) / 2 for p in P]
res = 0
for i in range(N + 1):
    res += D[i]
    if i >= K:
        res -= D[i - K]
        ans = max(res, ans)
print(ans)

-B = [0] - - -def f(p): -    return p * (1 + p) // 2 / p - - -for i in range(N): -    B.append(B[i] + f(P[i])) -for i in range(K, N + 1): -    ans = max(ans, B[i] - B[i - K]) +D = [0] + [(p + 1) / 2 for p in P] +res = 0 +for i in range(N + 1): +    res += D[i] +    if i >= K: +        res -= D[i - K] +        ans = max(res, ans)