import queue



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

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



queue = queue.Queue()

currentSum = 0

maxSum = 0

for i in range(len(p)):

    currentSum = currentSum + p[i] + 1

    queue.put(p[i] + 1)

    if i >= K:

        currentSum = currentSum - queue.get()



    if i >= K - 1:

        maxSum = max(maxSum, currentSum)



print(("{:.12f}".format(maxSum / 2)))

from collections import deque



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

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



queue = deque()

currentSum = 0

maxSum = 0

for i in range(len(p)):

    currentSum = currentSum + p[i] + 1

    queue.append(p[i] + 1)

    if i >= K:

        currentSum = currentSum - queue.popleft()



    if i >= K - 1:

        maxSum = max(maxSum, currentSum)



print(("{:.12f}".format(maxSum / 2)))

import queue

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
queue = queue.Queue()
currentSum = 0
maxSum = 0
for i in range(len(p)):
    currentSum = currentSum + p[i] + 1
    queue.put(p[i] + 1)
    if i >= K:
        currentSum = currentSum - queue.get()
    if i >= K - 1:
        maxSum = max(maxSum, currentSum)
print(("{:.12f}".format(maxSum / 2)))

from collections import deque

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
queue = deque()
currentSum = 0
maxSum = 0
for i in range(len(p)):
    currentSum = currentSum + p[i] + 1
    queue.append(p[i] + 1)
    if i >= K:
        currentSum = currentSum - queue.popleft()
    if i >= K - 1:
        maxSum = max(maxSum, currentSum)
print(("{:.12f}".format(maxSum / 2)))

-import queue +from collections import deque -queue = queue.Queue() +queue = deque() -    queue.put(p[i] + 1) +    queue.append(p[i] + 1) -        currentSum = currentSum - queue.get() +        currentSum = currentSum - queue.popleft()