from itertools import accumulate

N, K = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(lambda x: (x+1)/2, P))

Q_cum = list(accumulate([0] + Q))
res = 0
for i in range(N-K+1):
    temp = Q_cum[i+K]- Q_cum[i]
    res = max(res, temp)
print(res) from itertools import accumulate N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K P = list(map(int, input().split())) P list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split Q = list(map(lambda x: (x+1)/2, P)) Q list(map(lambda x: (x+1)/2, P)) list map(lambda x: (x+1)/2, P) map lambda x: (x+1)/2 (x+1)/2 x+1 x 1 2 x P Q_cum = list(accumulate([0] + Q)) Q_cum list(accumulate([0] + Q)) list accumulate([0] + Q) accumulate [0] + Q [0] 0 Q res = 0 res 0 for i in range(N-K+1):
    temp = Q_cum[i+K]- Q_cum[i]
    res = max(res, temp) i range(N-K+1) range N-K+1 N-K N K 1 temp = Q_cum[i+K]- Q_cum[i] temp Q_cum[i+K]- Q_cum[i] Q_cum[i+K] Q_cum i+K i K Q_cum[i] Q_cum i res = max(res, temp) res max(res, temp) max res temp print(res) print res Q = list(map(lambda x: (x+1)/2, P)) list(map(lambda x: (x+1)/2, P)) Q Q_cum = list(accumulate([0] + Q)) list(accumulate([0] + Q)) Q_cum res = 0 0 res N, K = map(int, input().split()) map(int, input().split()) N K = map(int, input().split()) map(int, input().split()) K res = max(res, temp) max(res, temp) res P = list(map(int, input().split())) list(map(int, input().split())) P temp = Q_cum[i+K]- Q_cum[i] Q_cum[i+K]- Q_cum[i] temp
from itertools import accumulate

N, K = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(lambda x: (x+1)/2, P))

Q_cum = list(accumulate([0] + Q))
res = 0
for i in range(N-K+1):
    temp = Q_cum[i+K]- Q_cum[i]
    res = max(res, temp)
print(res)