from itertools import accumulate

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

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

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

S_list = []

S = 0

for i in range(N+1):

    S += P[i]

    S_list.append(S)



B = []

for j in range(N-K+1):

    B.append(S_list[j+K]-S_list[j])

ans = max(B)

print(ans)

    



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

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

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

sm = sum(P[:K])  # 先頭のK個の和を計算

ans = sm  #  最大値（答え）を保存する

for i in range(N-K):

    sm = sm - P[i] + P[K+i]  # 窓をずらす

    ans = max(ans, sm)  # 最大値（答え）を更新

print (ans)
from itertools import accumulate

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
P = [0] + [(p + 1) / 2 for p in P]
S_list = []
S = 0
for i in range(N + 1):
    S += P[i]
    S_list.append(S)
B = []
for j in range(N - K + 1):
    B.append(S_list[j + K] - S_list[j])
ans = max(B)
print(ans)

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
P = [(p + 1) / 2 for p in P]
sm = sum(P[:K])  # 先頭のK個の和を計算
ans = sm  #  最大値（答え）を保存する
for i in range(N - K):
    sm = sm - P[i] + P[K + i]  # 窓をずらす
    ans = max(ans, sm)  # 最大値（答え）を更新
print(ans)

-from itertools import accumulate - -P = [0] + [(p + 1) / 2 for p in P] -S_list = [] -S = 0 -for i in range(N + 1): -    S += P[i] -    S_list.append(S) -B = [] -for j in range(N - K + 1): -    B.append(S_list[j + K] - S_list[j]) -ans = max(B) +P = [(p + 1) / 2 for p in P] +sm = sum(P[:K])  # 先頭のK個の和を計算 +ans = sm  #  最大値（答え）を保存する +for i in range(N - K): +    sm = sm - P[i] + P[K + i]  # 窓をずらす +    ans = max(ans, sm)  # 最大値（答え）を更新