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

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



l = []

for i in range(N):

    l.append(((1+p[i])*p[i]/2)/p[i])



s = [0]*(N+1)

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

    s[i] = l[i-1]+s[i-1]



ans = 0

for i in range(K,len(s)):

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



if N == K:

    print((max(s)))

else:

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

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



l = []

for i in p:

    l.append((1/2*i*(i+1))/i)



s = [0]*len(l)

s[0] = l[0]

for i in range(1,len(l)):

    s[i] = s[i-1]+l[i]



ans = 0

for i in range(K,len(s)):

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



if N == K:

    print((max(s)))

    exit()



print(ans)
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
l = []
for i in range(N):
    l.append(((1 + p[i]) * p[i] / 2) / p[i])
s = [0] * (N + 1)
for i in range(1, N + 1):
    s[i] = l[i - 1] + s[i - 1]
ans = 0
for i in range(K, len(s)):
    ans = max(ans, s[i] - s[i - K])
if N == K:
    print((max(s)))
else:
    print(ans)

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
l = []
for i in p:
    l.append((1 / 2 * i * (i + 1)) / i)
s = [0] * len(l)
s[0] = l[0]
for i in range(1, len(l)):
    s[i] = s[i - 1] + l[i]
ans = 0
for i in range(K, len(s)):
    ans = max(ans, s[i] - s[i - K])
if N == K:
    print((max(s)))
    exit()
print(ans)

-for i in range(N): -    l.append(((1 + p[i]) * p[i] / 2) / p[i]) -s = [0] * (N + 1) -for i in range(1, N + 1): -    s[i] = l[i - 1] + s[i - 1] +for i in p: +    l.append((1 / 2 * i * (i + 1)) / i) +s = [0] * len(l) +s[0] = l[0] +for i in range(1, len(l)): +    s[i] = s[i - 1] + l[i] -else: -    print(ans) +    exit() +print(ans)