from collections import deque

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

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



adjacent = deque()

for i in range(k):

    adjacent.append(p.popleft())



ans = sum(adjacent)

count = ans



while p:

    pp = p.popleft()

    count -= adjacent.popleft()

    count += pp

    adjacent.append(pp)

    ans = max(ans, count)



print(((ans + k) / 2))
from collections import deque

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

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



adjacent = deque()

for i in range(k):

    adjacent.append(p.pop())



ans = sum(adjacent)

count = ans



while p:

    pp = p.pop()

    count -= adjacent.popleft()

    count += pp

    adjacent.append(pp)

    ans = max(ans, count)



print(((ans + k) / 2))
from collections import deque

n, k = list(map(int, input().split()))
p = deque(list(map(int, input().split())))
adjacent = deque()
for i in range(k):
    adjacent.append(p.popleft())
ans = sum(adjacent)
count = ans
while p:
    pp = p.popleft()
    count -= adjacent.popleft()
    count += pp
    adjacent.append(pp)
    ans = max(ans, count)
print(((ans + k) / 2))

from collections import deque

n, k = list(map(int, input().split()))
p = deque(list(map(int, input().split())))
adjacent = deque()
for i in range(k):
    adjacent.append(p.pop())
ans = sum(adjacent)
count = ans
while p:
    pp = p.pop()
    count -= adjacent.popleft()
    count += pp
    adjacent.append(pp)
    ans = max(ans, count)
print(((ans + k) / 2))

-    adjacent.append(p.popleft()) +    adjacent.append(p.pop()) -    pp = p.popleft() +    pp = p.pop()