n, k = list(map(int, input().split()))

p = list(map(int, input().split()))

max_sum_k = 0

cum_sum = [0] * (n+1)

cum_sum[0] = 0

cum_sum[1] = p[0]

for i in range(2, n+1):

    cum_sum[i] = p[i-1] + cum_sum[i-1]



for i in range(k, n + 1):

    sum_p = cum_sum[i] - cum_sum[i-k]

    if sum_p > max_sum_k:

        max_sum_k = sum_p



max_ex = (k + max_sum_k) / 2

print(max_ex)

from itertools import accumulate





n, k = list(map(int, input().split()))

p = list(map(int, input().split()))

max_sum_k = 0

cum_sum = [0] + list(accumulate(p))

for i in range(k-1, n + 1):

    sum_p = cum_sum[i] - cum_sum[i-k]

    if sum_p > max_sum_k:

        max_sum_k = sum_p



max_ex = (k + max_sum_k) / 2

print(max_ex)

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
max_sum_k = 0
cum_sum = [0] * (n + 1)
cum_sum[0] = 0
cum_sum[1] = p[0]
for i in range(2, n + 1):
    cum_sum[i] = p[i - 1] + cum_sum[i - 1]
for i in range(k, n + 1):
    sum_p = cum_sum[i] - cum_sum[i - k]
    if sum_p > max_sum_k:
        max_sum_k = sum_p
max_ex = (k + max_sum_k) / 2
print(max_ex)

from itertools import accumulate

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
max_sum_k = 0
cum_sum = [0] + list(accumulate(p))
for i in range(k - 1, n + 1):
    sum_p = cum_sum[i] - cum_sum[i - k]
    if sum_p > max_sum_k:
        max_sum_k = sum_p
max_ex = (k + max_sum_k) / 2
print(max_ex)

+from itertools import accumulate + -cum_sum = [0] * (n + 1) -cum_sum[0] = 0 -cum_sum[1] = p[0] -for i in range(2, n + 1): -    cum_sum[i] = p[i - 1] + cum_sum[i - 1] -for i in range(k, n + 1): +cum_sum = [0] + list(accumulate(p)) +for i in range(k - 1, n + 1):