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

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



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



for i in range(1, n):

    p[i] = p[i-1] + p[i]



m = p[k-1]

for i in range(k, n):

    a = p[i] - p[i-k]

    if m < a:

        m = a



print(m)
from itertools import accumulate

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

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



A = list(accumulate(P))



largest = A[K-1]

point = 0

for i in range(K, N):

    if largest < A[i] - A[i-K]:

        largest = A[i] - A[i-K]

        point = i



ans = 0

for j in range(point - K + 1, point+1):

    p = P[j]

    ans += (((p + 1) * p) / 2) / p



print(ans)
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
p = list([x * (x + 1) / 2 / x for x in p])
for i in range(1, n):
    p[i] = p[i - 1] + p[i]
m = p[k - 1]
for i in range(k, n):
    a = p[i] - p[i - k]
    if m < a:
        m = a
print(m)

from itertools import accumulate

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
A = list(accumulate(P))
largest = A[K - 1]
point = 0
for i in range(K, N):
    if largest < A[i] - A[i - K]:
        largest = A[i] - A[i - K]
        point = i
ans = 0
for j in range(point - K + 1, point + 1):
    p = P[j]
    ans += (((p + 1) * p) / 2) / p
print(ans)

-n, k = list(map(int, input().split())) -p = list(map(int, input().split())) -p = list([x * (x + 1) / 2 / x for x in p]) -for i in range(1, n): -    p[i] = p[i - 1] + p[i] -m = p[k - 1] -for i in range(k, n): -    a = p[i] - p[i - k] -    if m < a: -        m = a -print(m) +from itertools import accumulate + +N, K = list(map(int, input().split())) +P = list(map(int, input().split())) +A = list(accumulate(P)) +largest = A[K - 1] +point = 0 +for i in range(K, N): +    if largest < A[i] - A[i - K]: +        largest = A[i] - A[i - K] +        point = i +ans = 0 +for j in range(point - K + 1, point + 1): +    p = P[j] +    ans += (((p + 1) * p) / 2) / p +print(ans)