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

P = [(int(x)+1)/2 for x in input().split()]



Q=[0]*(N+1)

for n in range(N):

  Q[n+1]=Q[n]+P[n]



ans=0

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

  ans=max(ans, Q[n]-Q[n-K])



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

P = [(int(x)+1)/2 for x in input().split()]



total=ans=sum(P[:K])

for n in range(K,N):

  total+=P[n]-P[n-K]

  ans=max(ans, total)



print(ans)

N, K = list(map(int, input().split()))
P = [(int(x) + 1) / 2 for x in input().split()]
Q = [0] * (N + 1)
for n in range(N):
    Q[n + 1] = Q[n] + P[n]
ans = 0
for n in range(K, N + 1):
    ans = max(ans, Q[n] - Q[n - K])
print(ans)

N, K = list(map(int, input().split()))
P = [(int(x) + 1) / 2 for x in input().split()]
total = ans = sum(P[:K])
for n in range(K, N):
    total += P[n] - P[n - K]
    ans = max(ans, total)
print(ans)

-Q = [0] * (N + 1) -for n in range(N): -    Q[n + 1] = Q[n] + P[n] -ans = 0 -for n in range(K, N + 1): -    ans = max(ans, Q[n] - Q[n - K]) +total = ans = sum(P[:K]) +for n in range(K, N): +    total += P[n] - P[n - K] +    ans = max(ans, total)