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) / 2 for i in p]

p = [0] + p

P = list(accumulate(p))

answer = max(b - a for a, b in zip(P, P[K:]))



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) / 2 for i in p]
p = [0] + p
P = list(accumulate(p))
answer = max(b - a for a, b in zip(P, P[K:]))
print(answer)

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