import numpy as np

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

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

p += 1

sum_E = np.cumsum(p)

sum_e = np.append([0], sum_E)

ans = -1

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

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

print((ans/2))
n, k = list(map(int, input().split()))

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



def calc(x):

    return (x + 1) / 2





w = 0



for i in range(k):

    w += calc(p[i])



ans = w

for i in range(k, n):

    w += calc(p[i]) - calc(p[i - k])

    ans = max(ans, w)

print(ans)
import numpy as np

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

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


def calc(x):
    return (x + 1) / 2


w = 0
for i in range(k):
    w += calc(p[i])
ans = w
for i in range(k, n):
    w += calc(p[i]) - calc(p[i - k])
    ans = max(ans, w)
print(ans)

-import numpy as np +n, k = list(map(int, input().split())) +p = list(map(int, input().split())) -n, k = list(map(int, input().split())) -p = np.array(list(map(int, input().split()))) -p += 1 -sum_E = np.cumsum(p) -sum_e = np.append([0], sum_E) -ans = -1 -for i in range(n - k + 1): -    ans = max(ans, sum_e[i + k] - sum_e[i]) -print((ans / 2)) + +def calc(x): +    return (x + 1) / 2 + + +w = 0 +for i in range(k): +    w += calc(p[i]) +ans = w +for i in range(k, n): +    w += calc(p[i]) - calc(p[i - k]) +    ans = max(ans, w) +print(ans)