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



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



iter_num = n - k + 1



num = sum(p[0:k])

ans = [(num+k)/2]

for i in range(iter_num-1):

	num = num - p[i] + p[k+i]

	ans.append((num+k)/2)



print((max(ans)))

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



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



tmp = sum(p[:k])

res = tmp

start = 0

end = k-1

for i in range(n-k):

  tmp -= p[i]

  tmp += p[k+i]

  if res < tmp:

    res = tmp

    start = i+1

    end = k+i



ans = 0

for i in range(start,end+1):

  if p[i] % 2 == 0:

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

  else:

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

print(ans)

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
iter_num = n - k + 1
num = sum(p[0:k])
ans = [(num + k) / 2]
for i in range(iter_num - 1):
    num = num - p[i] + p[k + i]
    ans.append((num + k) / 2)
print((max(ans)))

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
tmp = sum(p[:k])
res = tmp
start = 0
end = k - 1
for i in range(n - k):
    tmp -= p[i]
    tmp += p[k + i]
    if res < tmp:
        res = tmp
        start = i + 1
        end = k + i
ans = 0
for i in range(start, end + 1):
    if p[i] % 2 == 0:
        ans += ((p[i] + 1) * (p[i] // 2)) / p[i]
    else:
        ans += (1 + p[i] // 2 + (p[i] + 1) * (p[i] // 2)) / p[i]
print(ans)

-iter_num = n - k + 1 -num = sum(p[0:k]) -ans = [(num + k) / 2] -for i in range(iter_num - 1): -    num = num - p[i] + p[k + i] -    ans.append((num + k) / 2) -print((max(ans))) +tmp = sum(p[:k]) +res = tmp +start = 0 +end = k - 1 +for i in range(n - k): +    tmp -= p[i] +    tmp += p[k + i] +    if res < tmp: +        res = tmp +        start = i + 1 +        end = k + i +ans = 0 +for i in range(start, end + 1): +    if p[i] % 2 == 0: +        ans += ((p[i] + 1) * (p[i] // 2)) / p[i] +    else: +        ans += (1 + p[i] // 2 + (p[i] + 1) * (p[i] // 2)) / p[i] +print(ans)