import sys

from itertools import accumulate



read = sys.stdin.read



N, K, *p = list(map(int, read().split()))



p = [(1 + i) * i // 2 / i for i in p]

p = [0] + p

P = list(accumulate(p))

answer = 0



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

    s = P[i] - P[i - K]

    if s > answer:

        answer = s



print(answer)

import sys

from itertools import accumulate



read = sys.stdin.read



N, K, *p = list(map(int, read().split()))



p = [(1 + i) / 2 for i in p]

p = [0] + p

P = list(accumulate(p))

answer = max(P[i] - P[i - K] for i in range(K, N + 1))



print(answer)

import sys
from itertools import accumulate

read = sys.stdin.read
N, K, *p = list(map(int, read().split()))
p = [(1 + i) * i // 2 / i for i in p]
p = [0] + p
P = list(accumulate(p))
answer = 0
for i in range(K, N + 1):
    s = P[i] - P[i - K]
    if s > answer:
        answer = s
print(answer)

import sys
from itertools import accumulate

read = sys.stdin.read
N, K, *p = list(map(int, read().split()))
p = [(1 + i) / 2 for i in p]
p = [0] + p
P = list(accumulate(p))
answer = max(P[i] - P[i - K] for i in range(K, N + 1))
print(answer)

-p = [(1 + i) * i // 2 / i for i in p] +p = [(1 + i) / 2 for i in p] -answer = 0 -for i in range(K, N + 1): -    s = P[i] - P[i - K] -    if s > answer: -        answer = s +answer = max(P[i] - P[i - K] for i in range(K, N + 1))