import numpy as np



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

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



s = np.cumsum(p)

# print(p, s)



m = []





def partsum(s, x):

    global K

    if x == K - 1:

        return s[x]

    return s[x] - s[x - K]





for i in range(K - 1, N):

    m.append(partsum(s, i))

# print(m)



idx = m.index(max(m))

# print(idx)



ans = 0

for j in range(idx, idx + K):

    ans += (p[j] + 1) / 2

print(ans)

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())))
s = np.cumsum(p)
# print(p, s)
m = []


def partsum(s, x):
    global K
    if x == K - 1:
        return s[x]
    return s[x] - s[x - K]


for i in range(K - 1, N):
    m.append(partsum(s, i))
# print(m)
idx = m.index(max(m))
# print(idx)
ans = 0
for j in range(idx, idx + K):
    ans += (p[j] + 1) / 2
print(ans)

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 +from collections import deque -p = np.array(list(map(int, input().split()))) -s = np.cumsum(p) -# print(p, s) -m = [] - - -def partsum(s, x): -    global K -    if x == K - 1: -        return s[x] -    return s[x] - s[x - K] - - -for i in range(K - 1, N): -    m.append(partsum(s, i)) -# print(m) -idx = m.index(max(m)) -# print(idx) -ans = 0 -for j in range(idx, idx + K): -    ans += (p[j] + 1) / 2 -print(ans) +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))