import numpy as np

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

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



l = []

for i in range(N):

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



a = [0] * N

a[0] = l[0]

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

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



ans = 0

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

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



if N - K == 0:

    print((max(a)))

else:

    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])



que = [0]*(N+1)

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

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



ans = 0

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

    ans = max(ans,que[i+1]-que[i+1-K])



if N == K:

    print((max(que)))

else:

    print(ans)
import numpy as np

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
l = []
for i in range(N):
    l.append((1 + p[i]) / 2)
a = [0] * N
a[0] = l[0]
for i in range(1, len(l)):
    a[i] = a[i - 1] + l[i]
ans = 0
for i in range(K, len(l)):
    ans = max(ans, a[i] - a[i - K])
if N - K == 0:
    print((max(a)))
else:
    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])
que = [0] * (N + 1)
for i in range(1, N + 1):
    que[i] = l[i - 1] + que[i - 1]
ans = 0
for i in range(K, len(l)):
    ans = max(ans, que[i + 1] - que[i + 1 - K])
if N == K:
    print((max(que)))
else:
    print(ans)

-import numpy as np - -    l.append((1 + p[i]) / 2) -a = [0] * N -a[0] = l[0] -for i in range(1, len(l)): -    a[i] = a[i - 1] + l[i] +    l.append(((1 + p[i]) * (p[i] / 2)) / p[i]) +que = [0] * (N + 1) +for i in range(1, N + 1): +    que[i] = l[i - 1] + que[i - 1] -    ans = max(ans, a[i] - a[i - K]) -if N - K == 0: -    print((max(a))) +    ans = max(ans, que[i + 1] - que[i + 1 - K]) +if N == K: +    print((max(que)))