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

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



def expect(p):

  return (1+p)/2



tmp = sum([expect(p) for p in P[:K]])

maxV = tmp

for i in range(N-K):

  tmp -= expect(P[i]) 

  tmp += expect(P[i+K])

  maxV = max(maxV, tmp)

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

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



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



tmp = sum(P[:K])

maxV = tmp



for i in range(N-K):

  tmp += P[i+K] - P[i]

  maxV = max(maxV, tmp)

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


def expect(p):
    return (1 + p) / 2


tmp = sum([expect(p) for p in P[:K]])
maxV = tmp
for i in range(N - K):
    tmp -= expect(P[i])
    tmp += expect(P[i + K])
    maxV = max(maxV, tmp)
print(maxV)

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
P = [(1 + p) / 2 for p in P]
tmp = sum(P[:K])
maxV = tmp
for i in range(N - K):
    tmp += P[i + K] - P[i]
    maxV = max(maxV, tmp)
print(maxV)

- - -def expect(p): -    return (1 + p) / 2 - - -tmp = sum([expect(p) for p in P[:K]]) +P = [(1 + p) / 2 for p in P] +tmp = sum(P[:K]) -    tmp -= expect(P[i]) -    tmp += expect(P[i + K]) +    tmp += P[i + K] - P[i]