from itertools import accumulate
N, K = map(int, input().split())
P = [0]+list(map(int, input().split()))
Psum = list(accumulate(P))
total = 0
for i in range(K, N+1):
    if Psum[i]-Psum[i-K] > total:
        total = Psum[i]-Psum[i-K]
        index = i
ans = 0
for i in range(index, index-K, -1):
    ans += (P[i]+1)*0.5

print(ans) from itertools import accumulate N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K P = [0]+list(map(int, input().split())) P [0]+list(map(int, input().split())) [0] 0 list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split Psum = list(accumulate(P)) Psum list(accumulate(P)) list accumulate(P) accumulate P total = 0 total 0 for i in range(K, N+1):
    if Psum[i]-Psum[i-K] > total:
        total = Psum[i]-Psum[i-K]
        index = i i range(K, N+1) range K N+1 N 1 if Psum[i]-Psum[i-K] > total:
        total = Psum[i]-Psum[i-K]
        index = i Psum[i]-Psum[i-K] > total Psum[i]-Psum[i-K] Psum[i] Psum i Psum[i-K] Psum i-K i K total total = Psum[i]-Psum[i-K] total Psum[i]-Psum[i-K] Psum[i] Psum i Psum[i-K] Psum i-K i K index = i index i ans = 0 ans 0 for i in range(index, index-K, -1):
    ans += (P[i]+1)*0.5 i range(index, index-K, -1) range index index-K index K -1 ans += (P[i]+1)*0.5 ans (P[i]+1)*0.5 P[i]+1 P[i] P i 1 0.5 print(ans) print ans K = map(int, input().split()) map(int, input().split()) K Psum = list(accumulate(P)) list(accumulate(P)) Psum ans = 0 0 ans total = Psum[i]-Psum[i-K] Psum[i]-Psum[i-K] total N, K = map(int, input().split()) map(int, input().split()) N ans += (P[i]+1)*0.5 (P[i]+1)*0.5 ans total = 0 0 total P = [0]+list(map(int, input().split())) [0]+list(map(int, input().split())) P index = i i index
from itertools import accumulate
N, K = map(int, input().split())
P = [0]+list(map(int, input().split()))
Psum = list(accumulate(P))
total = 0
for i in range(K, N+1):
    if Psum[i]-Psum[i-K] > total:
        total = Psum[i]-Psum[i-K]
        index = i
ans = 0
for i in range(index, index-K, -1):
    ans += (P[i]+1)*0.5

print(ans)
