n,k,*a=map(int,open(0).read().split())
b=[q+1 for q in a]
ans=sum(b[:k])
now=ans
for i in range(k,n):
  now=now+b[i]-b[i-k]
  ans=max(ans,now)
print(ans/2) n,k,*a=map(int,open(0).read().split()) n map(int,open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split k *a a q+1 for q in a for q in a q a for q in a q+1 q 1 b=[q+1 for q in a] b [q+1 for q in a] ans=sum(b[:k]) ans sum(b[:k]) sum b[:k] b :k k now=ans now ans for i in range(k,n):
  now=now+b[i]-b[i-k]
  ans=max(ans,now) i range(k,n) range k n now=now+b[i]-b[i-k] now now+b[i]-b[i-k] now+b[i] now b[i] b i b[i-k] b i-k i k ans=max(ans,now) ans max(ans,now) max ans now print(ans/2) print ans/2 ans 2 k,*a=map(int,open(0).read().split()) map(int,open(0).read().split()) k now=now+b[i]-b[i-k] now+b[i]-b[i-k] now ans=sum(b[:k]) sum(b[:k]) ans now=ans ans now n,k,*a=map(int,open(0).read().split()) map(int,open(0).read().split()) n ans=max(ans,now) max(ans,now) ans b=[q+1 for q in a] [q+1 for q in a] b
n,k,*a=map(int,open(0).read().split())
b=[q+1 for q in a]
ans=sum(b[:k])
now=ans
for i in range(k,n):
  now=now+b[i]-b[i-k]
  ans=max(ans,now)
print(ans/2)