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

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

check = [0]*1001

tmp_p = []

for p in P:

    if check[p]!=0:

        tmp_p.append(check[p])

    else:

        tmp = ((1+p)*p/2)/p #期待値の計算

        tmp_p.append(tmp)

ans = sum(tmp_p[0:k])

tmp_ans = ans

for i in range(n-k):

    tmp_ans += (tmp_p[k+i]-tmp_p[i])

    ans = max(ans, tmp_ans)

print(ans)

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

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

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



#期待値の累積和

S = [0]*(n+1)

for i in range(1, n+1):

    S[i] = S[i-1]+P[i-1]



ans = max([S[x]-S[x-k] for x in range(k,n+1)])

print(ans)
n, k = list(map(int, input().split()))
P = list(map(int, input().split()))
check = [0] * 1001
tmp_p = []
for p in P:
    if check[p] != 0:
        tmp_p.append(check[p])
    else:
        tmp = ((1 + p) * p / 2) / p  # 期待値の計算
        tmp_p.append(tmp)
ans = sum(tmp_p[0:k])
tmp_ans = ans
for i in range(n - k):
    tmp_ans += tmp_p[k + i] - tmp_p[i]
    ans = max(ans, tmp_ans)
print(ans)

n, k = list(map(int, input().split()))
P = list(map(int, input().split()))
P = [(1 + p) / 2 for p in P]
# 期待値の累積和
S = [0] * (n + 1)
for i in range(1, n + 1):
    S[i] = S[i - 1] + P[i - 1]
ans = max([S[x] - S[x - k] for x in range(k, n + 1)])
print(ans)

-check = [0] * 1001 -tmp_p = [] -for p in P: -    if check[p] != 0: -        tmp_p.append(check[p]) -    else: -        tmp = ((1 + p) * p / 2) / p  # 期待値の計算 -        tmp_p.append(tmp) -ans = sum(tmp_p[0:k]) -tmp_ans = ans -for i in range(n - k): -    tmp_ans += tmp_p[k + i] - tmp_p[i] -    ans = max(ans, tmp_ans) +P = [(1 + p) / 2 for p in P] +# 期待値の累積和 +S = [0] * (n + 1) +for i in range(1, n + 1): +    S[i] = S[i - 1] + P[i - 1] +ans = max([S[x] - S[x - k] for x in range(k, n + 1)])