n,k = map(int,input().split())
li = list(map(int,input().split()))

if n==k:
    ans = 0
    for i in li:
        ans += i*0.5+0.5
    print(ans)
    exit()

K = sum(li[:k])
ans = K
t = 0
for i in range(n-k):
    K += li[i+k] - li[i]
    if K > ans:
        ans = K
        t = i
ans = 0
for i in range(k):
    ans += li[t+i+1]*0.5 + 0.5
print(ans) n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k li = list(map(int,input().split())) li list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split if n==k:
    ans = 0
    for i in li:
        ans += i*0.5+0.5
    print(ans)
    exit() n==k n k ans = 0 ans 0 for i in li:
        ans += i*0.5+0.5
     i li ans += i*0.5+0.5 ans i*0.5+0.5 i*0.5 i 0.5 0.5 print(ans) print ans exit() exit K = sum(li[:k]) K sum(li[:k]) sum li[:k] li :k k ans = K ans K t = 0 t 0 for i in range(n-k):
    K += li[i+k] - li[i]
    if K > ans:
        ans = K
        t = i i range(n-k) range n-k n k K += li[i+k] - li[i] K li[i+k] - li[i] li[i+k] li i+k i k li[i] li i if K > ans:
        ans = K
        t = i K > ans K ans ans = K ans K t = i t i ans = 0 ans 0 for i in range(k):
    ans += li[t+i+1]*0.5 + 0.5 i range(k) range k ans += li[t+i+1]*0.5 + 0.5 ans li[t+i+1]*0.5 + 0.5 li[t+i+1]*0.5 li[t+i+1] li t+i+1 t+i t i 1 0.5 0.5 print(ans) print ans li = list(map(int,input().split())) list(map(int,input().split())) li ans += li[t+i+1]*0.5 + 0.5 li[t+i+1]*0.5 + 0.5 ans ans += i*0.5+0.5 i*0.5+0.5 ans t = 0 0 t K += li[i+k] - li[i] li[i+k] - li[i] K n,k = map(int,input().split()) map(int,input().split()) n K = sum(li[:k]) sum(li[:k]) K ans = 0 0 ans ans = K K ans t = i i t k = map(int,input().split()) map(int,input().split()) k ans = K K ans ans = 0 0 ans
n,k = map(int,input().split())
li = list(map(int,input().split()))

if n==k:
    ans = 0
    for i in li:
        ans += i*0.5+0.5
    print(ans)
    exit()

K = sum(li[:k])
ans = K
t = 0
for i in range(n-k):
    K += li[i+k] - li[i]
    if K > ans:
        ans = K
        t = i
ans = 0
for i in range(k):
    ans += li[t+i+1]*0.5 + 0.5
print(ans)