import copy
n, k = map(int, input().split())
P = list(map(int, input().split()))
U = [0]*n

for i in range(n):
    U[i] = (P[i]+1)/2

ans = sum(U[:k])
t = copy.copy(ans)

for i in range(n-k):
    t =  t+U[k+i]-U[i]
    ans = max(ans, t)
    
print(ans) import copy copy 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 U = [0]*n U [0]*n [0] 0 n for i in range(n):
    U[i] = (P[i]+1)/2 i range(n) range n U[i] = (P[i]+1)/2 U[i] U i (P[i]+1)/2 P[i]+1 P[i] P i 1 2 ans = sum(U[:k]) ans sum(U[:k]) sum U[:k] U :k k t = copy.copy(ans) t copy.copy(ans) copy.copy copy copy ans for i in range(n-k):
    t =  t+U[k+i]-U[i]
    ans = max(ans, t)
     i range(n-k) range n-k n k t =  t+U[k+i]-U[i] t t+U[k+i]-U[i] t+U[k+i] t U[k+i] U k+i k i U[i] U i ans = max(ans, t) ans max(ans, t) max ans t print(ans) print ans n, k = map(int, input().split()) map(int, input().split()) n U = [0]*n [0]*n U ans = sum(U[:k]) sum(U[:k]) ans t = copy.copy(ans) copy.copy(ans) t k = map(int, input().split()) map(int, input().split()) k ans = max(ans, t) max(ans, t) ans P = list(map(int, input().split())) list(map(int, input().split())) P t =  t+U[k+i]-U[i] t+U[k+i]-U[i] t
import copy
n, k = map(int, input().split())
P = list(map(int, input().split()))
U = [0]*n

for i in range(n):
    U[i] = (P[i]+1)/2

ans = sum(U[:k])
t = copy.copy(ans)

for i in range(n-k):
    t =  t+U[k+i]-U[i]
    ans = max(ans, t)
    
print(ans)
