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

pos = [(p[i]+1)/2 for i in range(N)]

pos_acum = list(itertools.accumulate(pos))

ans = pos_acum[K-1]
for i in range(N-K):
    ans = max(ans, pos_acum[K+i]-pos_acum[i])
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 (p[i]+1)/2 for i in range(N) for i in range(N) i range(N) range N for i in range(N) (p[i]+1)/2 p[i]+1 p[i] p i 1 2 pos = [(p[i]+1)/2 for i in range(N)] pos [(p[i]+1)/2 for i in range(N)] pos_acum = list(itertools.accumulate(pos)) pos_acum list(itertools.accumulate(pos)) list itertools.accumulate(pos) itertools.accumulate itertools accumulate pos ans = pos_acum[K-1] ans pos_acum[K-1] pos_acum K-1 K 1 for i in range(N-K):
    ans = max(ans, pos_acum[K+i]-pos_acum[i]) i range(N-K) range N-K N K ans = max(ans, pos_acum[K+i]-pos_acum[i]) ans max(ans, pos_acum[K+i]-pos_acum[i]) max ans pos_acum[K+i]-pos_acum[i] pos_acum[K+i] pos_acum K+i K i pos_acum[i] pos_acum i print(ans) print ans pos_acum = list(itertools.accumulate(pos)) list(itertools.accumulate(pos)) pos_acum pos = [(p[i]+1)/2 for i in range(N)] [(p[i]+1)/2 for i in range(N)] pos N, K = map(int, input().split()) map(int, input().split()) N K = map(int, input().split()) map(int, input().split()) K p = list(map(int, input().split())) list(map(int, input().split())) p ans = max(ans, pos_acum[K+i]-pos_acum[i]) max(ans, pos_acum[K+i]-pos_acum[i]) ans ans = pos_acum[K-1] pos_acum[K-1] ans
import itertools
N, K = map(int, input().split())
p = list(map(int, input().split()))

pos = [(p[i]+1)/2 for i in range(N)]

pos_acum = list(itertools.accumulate(pos))

ans = pos_acum[K-1]
for i in range(N-K):
    ans = max(ans, pos_acum[K+i]-pos_acum[i])
print(ans)