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

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



sum_k = [0] * N

tmp = 0

for i in range(K):

    tmp += p[i]

sum_k[0] = tmp

max_sum = tmp

candidate = 0

for i in range(len(p)-K):

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

    if max_sum < sum_k[i+1]:

        max_sum = sum_k[i+1]

        candidate = i+1





dice = [-1] * 10000



ans = 0

for i in range(candidate, candidate + K):

    tmp = 0

    if dice[p[i]+1] != -1:

        ans += dice[p[i]+1]

        continue

    for j in range(1, p[i]+1):

        tmp += j * (1 / p[i])

    dice[p[i]+1] = tmp

    ans += tmp

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

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



sum_k = [0] * N

tmp = 0

for i in range(K):

    tmp += p[i]

sum_k[0] = tmp

max_sum = tmp

candidate = 0

for i in range(len(p)-K):

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

    if max_sum < sum_k[i+1]:

        max_sum = sum_k[i+1]

        candidate = i+1





ans = 0

for i in range(candidate, candidate + K):

    ans += (1 + p[i]) / 2

print(ans)
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
sum_k = [0] * N
tmp = 0
for i in range(K):
    tmp += p[i]
sum_k[0] = tmp
max_sum = tmp
candidate = 0
for i in range(len(p) - K):
    sum_k[i + 1] = sum_k[i] - p[i] + p[i + K]
    if max_sum < sum_k[i + 1]:
        max_sum = sum_k[i + 1]
        candidate = i + 1
dice = [-1] * 10000
ans = 0
for i in range(candidate, candidate + K):
    tmp = 0
    if dice[p[i] + 1] != -1:
        ans += dice[p[i] + 1]
        continue
    for j in range(1, p[i] + 1):
        tmp += j * (1 / p[i])
    dice[p[i] + 1] = tmp
    ans += tmp
print(ans)

N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
sum_k = [0] * N
tmp = 0
for i in range(K):
    tmp += p[i]
sum_k[0] = tmp
max_sum = tmp
candidate = 0
for i in range(len(p) - K):
    sum_k[i + 1] = sum_k[i] - p[i] + p[i + K]
    if max_sum < sum_k[i + 1]:
        max_sum = sum_k[i + 1]
        candidate = i + 1
ans = 0
for i in range(candidate, candidate + K):
    ans += (1 + p[i]) / 2
print(ans)

-dice = [-1] * 10000 -    tmp = 0 -    if dice[p[i] + 1] != -1: -        ans += dice[p[i] + 1] -        continue -    for j in range(1, p[i] + 1): -        tmp += j * (1 / p[i]) -    dice[p[i] + 1] = tmp -    ans += tmp +    ans += (1 + p[i]) / 2