from itertools import accumulate
n,k = map(int,input().split())
l = [0] + list(map(int,input().split()))
for i in range(n):
    l[i+1] = (l[i+1]+1)/2
acc = list(accumulate(l))
# print(acc)
maxi = 0
for i in range(n-k+1):
    maxi = max(maxi,acc[i+k]-acc[i])
print(maxi) from itertools import accumulate n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k l = [0] + list(map(int,input().split())) l [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 for i in range(n):
    l[i+1] = (l[i+1]+1)/2 i range(n) range n l[i+1] = (l[i+1]+1)/2 l[i+1] l i+1 i 1 (l[i+1]+1)/2 l[i+1]+1 l[i+1] l i+1 i 1 1 2 acc = list(accumulate(l)) acc list(accumulate(l)) list accumulate(l) accumulate l maxi = 0 maxi 0 for i in range(n-k+1):
    maxi = max(maxi,acc[i+k]-acc[i]) i range(n-k+1) range n-k+1 n-k n k 1 maxi = max(maxi,acc[i+k]-acc[i]) maxi max(maxi,acc[i+k]-acc[i]) max maxi acc[i+k]-acc[i] acc[i+k] acc i+k i k acc[i] acc i print(maxi) print maxi k = map(int,input().split()) map(int,input().split()) k maxi = 0 0 maxi n,k = map(int,input().split()) map(int,input().split()) n maxi = max(maxi,acc[i+k]-acc[i]) max(maxi,acc[i+k]-acc[i]) maxi l = [0] + list(map(int,input().split())) [0] + list(map(int,input().split())) l acc = list(accumulate(l)) list(accumulate(l)) acc
from itertools import accumulate
n,k = map(int,input().split())
l = [0] + list(map(int,input().split()))
for i in range(n):
    l[i+1] = (l[i+1]+1)/2
acc = list(accumulate(l))
# print(acc)
maxi = 0
for i in range(n-k+1):
    maxi = max(maxi,acc[i+k]-acc[i])
print(maxi)