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