from itertools import accumulate

import numpy as np



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

p = np.array(list(map(int, input().split())), dtype=np.int64)



p = (1 + p) / 2

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

ans = 0

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

    ans = max(ans, p[i + k] - p[i])

print(ans)

import numpy as np



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

p = np.array(list(map(int, input().split())), dtype="i8")

p = np.insert(np.cumsum((1 + p) / 2), 0, 0)

print(((p[k:] - p[:n - k + 1]).max()))
from itertools import accumulate
import numpy as np

n, k = list(map(int, input().split()))
p = np.array(list(map(int, input().split())), dtype=np.int64)
p = (1 + p) / 2
p = [0] + list(accumulate(p))
ans = 0
for i in range(n - k + 1):
    ans = max(ans, p[i + k] - p[i])
print(ans)

import numpy as np

n, k = list(map(int, input().split()))
p = np.array(list(map(int, input().split())), dtype="i8")
p = np.insert(np.cumsum((1 + p) / 2), 0, 0)
print(((p[k:] - p[: n - k + 1]).max()))

-from itertools import accumulate -p = np.array(list(map(int, input().split())), dtype=np.int64) -p = (1 + p) / 2 -p = [0] + list(accumulate(p)) -ans = 0 -for i in range(n - k + 1): -    ans = max(ans, p[i + k] - p[i]) -print(ans) +p = np.array(list(map(int, input().split())), dtype="i8") +p = np.insert(np.cumsum((1 + p) / 2), 0, 0) +print(((p[k:] - p[: n - k + 1]).max()))