import itertools
n,k=map(int,input().split())
p=list(map(int,input().split()))
l=[]
for i in range(n):
    exp=(p[i]+1)/2
    l.append(exp)
cumsum=[0]+list(itertools.accumulate(l))
ans=0
for i in range(n-k+1):
    sum_num=cumsum[i+k]-cumsum[i]
    if sum_num>ans:
        ans=sum_num
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 l=[] l [] for i in range(n):
    exp=(p[i]+1)/2
    l.append(exp) i range(n) range n exp=(p[i]+1)/2 exp (p[i]+1)/2 p[i]+1 p[i] p i 1 2 l.append(exp) l.append l append exp cumsum=[0]+list(itertools.accumulate(l)) cumsum [0]+list(itertools.accumulate(l)) [0] 0 list(itertools.accumulate(l)) list itertools.accumulate(l) itertools.accumulate itertools accumulate l ans=0 ans 0 for i in range(n-k+1):
    sum_num=cumsum[i+k]-cumsum[i]
    if sum_num>ans:
        ans=sum_num i range(n-k+1) range n-k+1 n-k n k 1 sum_num=cumsum[i+k]-cumsum[i] sum_num cumsum[i+k]-cumsum[i] cumsum[i+k] cumsum i+k i k cumsum[i] cumsum i if sum_num>ans:
        ans=sum_num sum_num>ans sum_num ans ans=sum_num ans sum_num print(ans) print ans l=[] [] l p=list(map(int,input().split())) list(map(int,input().split())) p cumsum=[0]+list(itertools.accumulate(l)) [0]+list(itertools.accumulate(l)) cumsum ans=0 0 ans n,k=map(int,input().split()) map(int,input().split()) n sum_num=cumsum[i+k]-cumsum[i] cumsum[i+k]-cumsum[i] sum_num exp=(p[i]+1)/2 (p[i]+1)/2 exp ans=sum_num sum_num ans k=map(int,input().split()) map(int,input().split()) k
import itertools
n,k=map(int,input().split())
p=list(map(int,input().split()))
l=[]
for i in range(n):
    exp=(p[i]+1)/2
    l.append(exp)
cumsum=[0]+list(itertools.accumulate(l))
ans=0
for i in range(n-k+1):
    sum_num=cumsum[i+k]-cumsum[i]
    if sum_num>ans:
        ans=sum_num
print(ans)