import itertools
 
n, k = map(int, input().split())
p = list(map(int, input().split()))
acc = [0] + list(itertools.accumulate([(x+1)/2 for x in p])) # 累積和を計算
 
ans = max(acc[i]-acc[i-k] for i in range(k, n+1)) # k番目からn番目まで計算
print(ans) import itertools itertools 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 (x+1)/2 for x in p for x in p x p for x in p (x+1)/2 x+1 x 1 2 acc = [0] + list(itertools.accumulate([(x+1)/2 for x in p])) acc [0] + list(itertools.accumulate([(x+1)/2 for x in p])) [0] 0 list(itertools.accumulate([(x+1)/2 for x in p])) list itertools.accumulate([(x+1)/2 for x in p]) itertools.accumulate itertools accumulate [(x+1)/2 for x in p] ans = max(acc[i]-acc[i-k] for i in range(k, n+1)) ans max(acc[i]-acc[i-k] for i in range(k, n+1)) max acc[i]-acc[i-k] acc[i] acc i acc[i-k] acc i-k i k print(ans) print ans n, k = map(int, input().split()) map(int, input().split()) n acc = [0] + list(itertools.accumulate([(x+1)/2 for x in p])) [0] + list(itertools.accumulate([(x+1)/2 for x in p])) acc k = map(int, input().split()) map(int, input().split()) k p = list(map(int, input().split())) list(map(int, input().split())) p ans = max(acc[i]-acc[i-k] for i in range(k, n+1)) max(acc[i]-acc[i-k] for i in range(k, n+1)) ans
import itertools
 
n, k = map(int, input().split())
p = list(map(int, input().split()))
acc = [0] + list(itertools.accumulate([(x+1)/2 for x in p])) # 累積和を計算
 
ans = max(acc[i]-acc[i-k] for i in range(k, n+1)) # k番目からn番目まで計算
print(ans)
