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

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



import numpy as np

exps = np.array(p) / 2 + 0.5



s = exps[:k].sum()

m = s

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

    s = s - exps[i-1] + exps[i+k-1]

    if s > m:

        m = s

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

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



import numpy as np

exps = np.array(p) / 2 + 0.5



# s = exps[:k].sum()

# m = s

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

#     s = s - exps[i-1] + exps[i+k-1]

#     if s > m:

#         m = s

# print(m)



cum = exps.cumsum()

diff = cum[k-1:n] - np.r_[0, cum[:n-k]]

print((diff.max()))
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
import numpy as np

exps = np.array(p) / 2 + 0.5
s = exps[:k].sum()
m = s
for i in range(1, n - k + 1):
    s = s - exps[i - 1] + exps[i + k - 1]
    if s > m:
        m = s
print(m)

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
import numpy as np

exps = np.array(p) / 2 + 0.5
# s = exps[:k].sum()
# m = s
# for i in range(1, n - k + 1):
#     s = s - exps[i-1] + exps[i+k-1]
#     if s > m:
#         m = s
# print(m)
cum = exps.cumsum()
diff = cum[k - 1 : n] - np.r_[0, cum[: n - k]]
print((diff.max()))

-s = exps[:k].sum() -m = s -for i in range(1, n - k + 1): -    s = s - exps[i - 1] + exps[i + k - 1] -    if s > m: -        m = s -print(m) +# s = exps[:k].sum() +# m = s +# for i in range(1, n - k + 1): +#     s = s - exps[i-1] + exps[i+k-1] +#     if s > m: +#         m = s +# print(m) +cum = exps.cumsum() +diff = cum[k - 1 : n] - np.r_[0, cum[: n - k]] +print((diff.max()))