from collections import deque



N, K = list(map(int, input().split()))

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



mx = 0

s = 0

q = deque()



for i in range(N):

    p[i] += 1



for i in range(N):

    s += p[i]

    q.append(p[i])

    if len(q) > K:

        s -= q.popleft()

    if len(q) == K:

        mx = max(mx, s)



print((mx / 2))



import numpy as np



N, K = list(map(int, input().split()))

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



e = (p + 1) / 2



# print(e)



cum_e = np.zeros(N + 1)

cum_e[1:] = np.cumsum(e)



# print(cum_e)



s = cum_e[K:] - cum_e[:-K]



print((max(s)))

from collections import deque

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
mx = 0
s = 0
q = deque()
for i in range(N):
    p[i] += 1
for i in range(N):
    s += p[i]
    q.append(p[i])
    if len(q) > K:
        s -= q.popleft()
    if len(q) == K:
        mx = max(mx, s)
print((mx / 2))

import numpy as np

N, K = list(map(int, input().split()))
p = np.array(list(map(int, input().split())))
e = (p + 1) / 2
# print(e)
cum_e = np.zeros(N + 1)
cum_e[1:] = np.cumsum(e)
# print(cum_e)
s = cum_e[K:] - cum_e[:-K]
print((max(s)))

-from collections import deque +import numpy as np -p = list(map(int, input().split())) -mx = 0 -s = 0 -q = deque() -for i in range(N): -    p[i] += 1 -for i in range(N): -    s += p[i] -    q.append(p[i]) -    if len(q) > K: -        s -= q.popleft() -    if len(q) == K: -        mx = max(mx, s) -print((mx / 2)) +p = np.array(list(map(int, input().split()))) +e = (p + 1) / 2 +# print(e) +cum_e = np.zeros(N + 1) +cum_e[1:] = np.cumsum(e) +# print(cum_e) +s = cum_e[K:] - cum_e[:-K] +print((max(s)))