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

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



loop_time = N - K



l_s = 0

l_e = K

max_score = 0

test_score = 0

# initial process

ans_list = p_list[l_s:l_e]

for j in ans_list:

    max_score += sum(range(1,j+1)) / j

    test_score = max_score

l_s = l_s + 1



for i in range(loop_time):

    # pop process

    pop_e = p_list[l_s-1]

    test_score = test_score - sum(range(1,pop_e+1)) / pop_e

    # push process

    push_e = p_list[l_e]

    test_score = test_score + sum(range(1,push_e+1)) / push_e

    if test_score > max_score:

        max_score = test_score

    l_s = l_s + 1

    l_e = l_e + 1



print(max_score)

# Problem D - Dice in Line



# input

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

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



# initialization

kitai_list = [0]*N

for i in range(N):

    p = p_list[i]

    p_sum = (1 + p)*p / 2

    p_ave = p_sum / p

    kitai_list[i] = p_ave

max_score = -1



# count

tmp = 0

for i in range(N):

    if i-K<0:

        tmp += kitai_list[i]

        max_score = max(max_score, tmp)

    else:

        tmp -= kitai_list[i-K]

        tmp += kitai_list[i]

        max_score = max(max_score, tmp)



# output

print(max_score)

N, K = list(map(int, input().split()))
p_list = list(map(int, input().split()))
loop_time = N - K
l_s = 0
l_e = K
max_score = 0
test_score = 0
# initial process
ans_list = p_list[l_s:l_e]
for j in ans_list:
    max_score += sum(range(1, j + 1)) / j
    test_score = max_score
l_s = l_s + 1
for i in range(loop_time):
    # pop process
    pop_e = p_list[l_s - 1]
    test_score = test_score - sum(range(1, pop_e + 1)) / pop_e
    # push process
    push_e = p_list[l_e]
    test_score = test_score + sum(range(1, push_e + 1)) / push_e
    if test_score > max_score:
        max_score = test_score
    l_s = l_s + 1
    l_e = l_e + 1
print(max_score)

# Problem D - Dice in Line
# input
N, K = list(map(int, input().split()))
p_list = list(map(int, input().split()))
# initialization
kitai_list = [0] * N
for i in range(N):
    p = p_list[i]
    p_sum = (1 + p) * p / 2
    p_ave = p_sum / p
    kitai_list[i] = p_ave
max_score = -1
# count
tmp = 0
for i in range(N):
    if i - K < 0:
        tmp += kitai_list[i]
        max_score = max(max_score, tmp)
    else:
        tmp -= kitai_list[i - K]
        tmp += kitai_list[i]
        max_score = max(max_score, tmp)
# output
print(max_score)

+# Problem D - Dice in Line +# input -loop_time = N - K -l_s = 0 -l_e = K -max_score = 0 -test_score = 0 -# initial process -ans_list = p_list[l_s:l_e] -for j in ans_list: -    max_score += sum(range(1, j + 1)) / j -    test_score = max_score -l_s = l_s + 1 -for i in range(loop_time): -    # pop process -    pop_e = p_list[l_s - 1] -    test_score = test_score - sum(range(1, pop_e + 1)) / pop_e -    # push process -    push_e = p_list[l_e] -    test_score = test_score + sum(range(1, push_e + 1)) / push_e -    if test_score > max_score: -        max_score = test_score -    l_s = l_s + 1 -    l_e = l_e + 1 +# initialization +kitai_list = [0] * N +for i in range(N): +    p = p_list[i] +    p_sum = (1 + p) * p / 2 +    p_ave = p_sum / p +    kitai_list[i] = p_ave +max_score = -1 +# count +tmp = 0 +for i in range(N): +    if i - K < 0: +        tmp += kitai_list[i] +        max_score = max(max_score, tmp) +    else: +        tmp -= kitai_list[i - K] +        tmp += kitai_list[i] +        max_score = max(max_score, tmp) +# output