n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = 0
for i in range(n):
    p[i] = (p[i] + 1)/2
ev = sum(p[:k])
if n == k:
    print(sum(p))
    exit()
for i in range(n - k):
    ev += (p[i + k] - p[i])
    ans = max(ans,ev)
print(ans)



     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 ans = 0 ans 0 for i in range(n):
    p[i] = (p[i] + 1)/2 i range(n) range n p[i] = (p[i] + 1)/2 p[i] p i (p[i] + 1)/2 p[i] + 1 p[i] p i 1 2 ev = sum(p[:k]) ev sum(p[:k]) sum p[:k] p :k k if n == k:
    print(sum(p))
    exit() n == k n k print(sum(p)) print sum(p) sum p exit() exit for i in range(n - k):
    ev += (p[i + k] - p[i])
    ans = max(ans,ev) i range(n - k) range n - k n k ev += (p[i + k] - p[i]) ev p[i + k] - p[i] p[i + k] p i + k i k p[i] p i ans = max(ans,ev) ans max(ans,ev) max ans ev print(ans) print ans ev += (p[i + k] - p[i]) p[i + k] - p[i] ev n,k = map(int,input().split()) map(int,input().split()) n k = map(int,input().split()) map(int,input().split()) k ans = 0 0 ans p = list(map(int,input().split())) list(map(int,input().split())) p ev = sum(p[:k]) sum(p[:k]) ev ans = max(ans,ev) max(ans,ev) ans
n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = 0
for i in range(n):
    p[i] = (p[i] + 1)/2
ev = sum(p[:k])
if n == k:
    print(sum(p))
    exit()
for i in range(n - k):
    ev += (p[i + k] - p[i])
    ans = max(ans,ev)
print(ans)



    
