from itertools import accumulate
N, K = map(int, input().split())
P = list(map(int, input().split()))

A = list(accumulate(P))

largest = A[K-1]
point = 0
for i in range(K, N):
    if largest < A[i] - A[i-K]:
        largest = A[i] - A[i-K]
        point = i

ans = 0
for j in range(point - K + 1, point+1):
    p = P[j]
    ans += (((p + 1) * p) / 2) / p

print(ans) from itertools import accumulate 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 A = list(accumulate(P)) A list(accumulate(P)) list accumulate(P) accumulate P largest = A[K-1] largest A[K-1] A K-1 K 1 point = 0 point 0 for i in range(K, N):
    if largest < A[i] - A[i-K]:
        largest = A[i] - A[i-K]
        point = i i range(K, N) range K N if largest < A[i] - A[i-K]:
        largest = A[i] - A[i-K]
        point = i largest < A[i] - A[i-K] largest A[i] - A[i-K] A[i] A i A[i-K] A i-K i K largest = A[i] - A[i-K] largest A[i] - A[i-K] A[i] A i A[i-K] A i-K i K point = i point i ans = 0 ans 0 for j in range(point - K + 1, point+1):
    p = P[j]
    ans += (((p + 1) * p) / 2) / p j range(point - K + 1, point+1) range point - K + 1 point - K point K 1 point+1 point 1 p = P[j] p P[j] P j ans += (((p + 1) * p) / 2) / p ans (((p + 1) * p) / 2) / p ((p + 1) * p) / 2 (p + 1) * p p + 1 p 1 p 2 p print(ans) print ans A = list(accumulate(P)) list(accumulate(P)) A point = 0 0 point point = i i point largest = A[K-1] A[K-1] largest ans += (((p + 1) * p) / 2) / p (((p + 1) * p) / 2) / p ans N, K = map(int, input().split()) map(int, input().split()) N p = P[j] P[j] p P = list(map(int, input().split())) list(map(int, input().split())) P K = map(int, input().split()) map(int, input().split()) K ans = 0 0 ans largest = A[i] - A[i-K] A[i] - A[i-K] largest
from itertools import accumulate
N, K = map(int, input().split())
P = list(map(int, input().split()))

A = list(accumulate(P))

largest = A[K-1]
point = 0
for i in range(K, N):
    if largest < A[i] - A[i-K]:
        largest = A[i] - A[i-K]
        point = i

ans = 0
for j in range(point - K + 1, point+1):
    p = P[j]
    ans += (((p + 1) * p) / 2) / p

print(ans)