import numpy as np

n,k=list(map(int, input().split()))

exp=list([(int(x)+1)/2 for x in input().split()]) # 入力と同時に期待値計算



l=np.cumsum(exp) # 累積和の計算



ans=l[k-1]

for i in range(n-k):

    ans=max(ans,l[i+k]-l[i])

    

print(ans)
n,k=list(map(int, input().split()))

exp=list([(int(x)+1)/2 for x in input().split()]) # 入力と同時に期待値計算



l=[0]*n

sum1=0

for i in range(n):# 累積和の計算

    sum1+=exp[i]

    l[i]=sum1 



ans=l[k-1]

for i in range(n-k):

    ans=max(ans,l[i+k]-l[i])

    

print(ans)
import numpy as np

n, k = list(map(int, input().split()))
exp = list([(int(x) + 1) / 2 for x in input().split()])  # 入力と同時に期待値計算
l = np.cumsum(exp)  # 累積和の計算
ans = l[k - 1]
for i in range(n - k):
    ans = max(ans, l[i + k] - l[i])
print(ans)

n, k = list(map(int, input().split()))
exp = list([(int(x) + 1) / 2 for x in input().split()])  # 入力と同時に期待値計算
l = [0] * n
sum1 = 0
for i in range(n):  # 累積和の計算
    sum1 += exp[i]
    l[i] = sum1
ans = l[k - 1]
for i in range(n - k):
    ans = max(ans, l[i + k] - l[i])
print(ans)

-import numpy as np - -l = np.cumsum(exp)  # 累積和の計算 +l = [0] * n +sum1 = 0 +for i in range(n):  # 累積和の計算 +    sum1 += exp[i] +    l[i] = sum1