N,K = map(int,input().split())
pls = list(map(int,input().split()))
ans = sum(pls[:K])/2 + 0.5*K
sum1 = ans
for i in range(1,N-K+1):
    sum1 += -pls[i-1]/2+pls[i+K-1]/2
    ans = max(ans,sum1) 
print(ans) N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K pls = list(map(int,input().split())) pls list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans = sum(pls[:K])/2 + 0.5*K ans sum(pls[:K])/2 + 0.5*K sum(pls[:K])/2 sum(pls[:K]) sum pls[:K] pls :K K 2 0.5*K 0.5 K sum1 = ans sum1 ans for i in range(1,N-K+1):
    sum1 += -pls[i-1]/2+pls[i+K-1]/2
    ans = max(ans,sum1)  i range(1,N-K+1) range 1 N-K+1 N-K N K 1 sum1 += -pls[i-1]/2+pls[i+K-1]/2 sum1 -pls[i-1]/2+pls[i+K-1]/2 -pls[i-1]/2 -pls[i-1] pls[i-1] pls i-1 i 1 2 pls[i+K-1]/2 pls[i+K-1] pls i+K-1 i+K i K 1 2 ans = max(ans,sum1) ans max(ans,sum1) max ans sum1 print(ans) print ans N,K = map(int,input().split()) map(int,input().split()) N sum1 += -pls[i-1]/2+pls[i+K-1]/2 -pls[i-1]/2+pls[i+K-1]/2 sum1 sum1 = ans ans sum1 K = map(int,input().split()) map(int,input().split()) K ans = sum(pls[:K])/2 + 0.5*K sum(pls[:K])/2 + 0.5*K ans ans = max(ans,sum1) max(ans,sum1) ans pls = list(map(int,input().split())) list(map(int,input().split())) pls
N,K = map(int,input().split())
pls = list(map(int,input().split()))
ans = sum(pls[:K])/2 + 0.5*K
sum1 = ans
for i in range(1,N-K+1):
    sum1 += -pls[i-1]/2+pls[i+K-1]/2
    ans = max(ans,sum1) 
print(ans)