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

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

l2 = [0 for _ in range(n+1)]

for i in range(n):

  l[i] = 1+l[i]

for i in range(n):

  l2[i + 1] = l2[i]+l[i]

l3 = []

for i in range(n-k+1):

  l3.append(l2[i+k]-l2[i])

print(("{:.8}".format(max(l3)/2)))
n,k = list(map(int, input().split()))

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

el = []

sl = [0]*(n-k+1)

for i in l:

  el.append((1+i)/2)

sl[0] = sum(el[:k])

for i in range(n-k):

  sl[i+1] = sl[i]-el[i]+el[i+k]

print(("{:.20}".format(max(sl))))
n, k = list(map(int, input().split()))
l = list(map(int, input().split()))
l2 = [0 for _ in range(n + 1)]
for i in range(n):
    l[i] = 1 + l[i]
for i in range(n):
    l2[i + 1] = l2[i] + l[i]
l3 = []
for i in range(n - k + 1):
    l3.append(l2[i + k] - l2[i])
print(("{:.8}".format(max(l3) / 2)))

n, k = list(map(int, input().split()))
l = list(map(int, input().split()))
el = []
sl = [0] * (n - k + 1)
for i in l:
    el.append((1 + i) / 2)
sl[0] = sum(el[:k])
for i in range(n - k):
    sl[i + 1] = sl[i] - el[i] + el[i + k]
print(("{:.20}".format(max(sl))))

-l2 = [0 for _ in range(n + 1)] -for i in range(n): -    l[i] = 1 + l[i] -for i in range(n): -    l2[i + 1] = l2[i] + l[i] -l3 = [] -for i in range(n - k + 1): -    l3.append(l2[i + k] - l2[i]) -print(("{:.8}".format(max(l3) / 2))) +el = [] +sl = [0] * (n - k + 1) +for i in l: +    el.append((1 + i) / 2) +sl[0] = sum(el[:k]) +for i in range(n - k): +    sl[i + 1] = sl[i] - el[i] + el[i + k] +print(("{:.20}".format(max(sl))))