N,K = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
pb = [(p[i] * (p[i] + 1)) / (p[i] * 2) for i in range(N)]
pr = sum(pb[:K])
m = pr
for i in range(N - K):
    pr += pb[i+K] - pb[i]
    m = max(m, pr)
print(m) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i N,K = [int(i) for i in input().split()] N [int(i) for i in input().split()] K int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i p = [int(i) for i in input().split()] p [int(i) for i in input().split()] (p[i] * (p[i] + 1)) / (p[i] * 2) for i in range(N) for i in range(N) i range(N) range N for i in range(N) (p[i] * (p[i] + 1)) / (p[i] * 2) p[i] * (p[i] + 1) p[i] p i p[i] + 1 p[i] p i 1 p[i] * 2 p[i] p i 2 pb = [(p[i] * (p[i] + 1)) / (p[i] * 2) for i in range(N)] pb [(p[i] * (p[i] + 1)) / (p[i] * 2) for i in range(N)] pr = sum(pb[:K]) pr sum(pb[:K]) sum pb[:K] pb :K K m = pr m pr for i in range(N - K):
    pr += pb[i+K] - pb[i]
    m = max(m, pr) i range(N - K) range N - K N K pr += pb[i+K] - pb[i] pr pb[i+K] - pb[i] pb[i+K] pb i+K i K pb[i] pb i m = max(m, pr) m max(m, pr) max m pr print(m) print m N,K = [int(i) for i in input().split()] [int(i) for i in input().split()] N K = [int(i) for i in input().split()] [int(i) for i in input().split()] K m = pr pr m p = [int(i) for i in input().split()] [int(i) for i in input().split()] p pr = sum(pb[:K]) sum(pb[:K]) pr pr += pb[i+K] - pb[i] pb[i+K] - pb[i] pr pb = [(p[i] * (p[i] + 1)) / (p[i] * 2) for i in range(N)] [(p[i] * (p[i] + 1)) / (p[i] * 2) for i in range(N)] pb m = max(m, pr) max(m, pr) m
N,K = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
pb = [(p[i] * (p[i] + 1)) / (p[i] * 2) for i in range(N)]
pr = sum(pb[:K])
m = pr
for i in range(N - K):
    pr += pb[i+K] - pb[i]
    m = max(m, pr)
print(m)