import queue



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

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



for i in range(len(p)):

    p[i] = p[i] + 1



queue = queue.Queue()

currentSum = 0

maxSum = 0

for i in range(len(p)):

    currentSum = currentSum + p[i]

    queue.put(p[i])

    if queue.qsize() > K:

        currentSum = currentSum - queue.get()

    

    if queue.qsize() == K:

        maxSum = max(maxSum, currentSum)



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

import queue



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

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



for i in range(len(p)):

    p[i] = p[i] + 1



queue = queue.Queue()

currentSum = 0

maxSum = 0

for i in range(len(p)):

    currentSum = currentSum + p[i]

    queue.put(p[i])

    if i >= K:

        currentSum = currentSum - queue.get()



    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()))
for i in range(len(p)):
    p[i] = p[i] + 1
queue = queue.Queue()
currentSum = 0
maxSum = 0
for i in range(len(p)):
    currentSum = currentSum + p[i]
    queue.put(p[i])
    if queue.qsize() > K:
        currentSum = currentSum - queue.get()
    if queue.qsize() == K:
        maxSum = max(maxSum, currentSum)
print(("{:.12f}".format(maxSum / 2)))

import queue

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

-    if queue.qsize() > K: +    if i >= K: -    if queue.qsize() == K: +    if i >= K - 1: