import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans) import sys sys 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 (1+p)/2 for p in P for p in P p P for p in P (1+p)/2 1+p 1 p 2 Q=[(1+p)/2 for p in P] Q [(1+p)/2 for p in P] temp=sum(Q[:K]) temp sum(Q[:K]) sum Q[:K] Q :K K ans=temp ans temp for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans) i range(N) range N try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass except:
    pass temp=temp-Q[i]+Q[i+K] temp temp-Q[i]+Q[i+K] temp-Q[i] temp Q[i] Q i Q[i+K] Q i+K i K ans=max(ans,temp) ans max(ans,temp) max ans temp print(ans) print ans P=list(map(int,input().split())) list(map(int,input().split())) P ans=temp temp ans temp=sum(Q[:K]) sum(Q[:K]) temp K=map(int,input().split()) map(int,input().split()) K ans=max(ans,temp) max(ans,temp) ans Q=[(1+p)/2 for p in P] [(1+p)/2 for p in P] Q temp=temp-Q[i]+Q[i+K] temp-Q[i]+Q[i+K] temp N,K=map(int,input().split()) map(int,input().split()) N
import sys

N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)
