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

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

for i in range(n):

    A[i]+=1



for i in range(n-1):

    A[i+1]+=A[i]



ans=0.0

A.reverse()

A.append(0)

A.reverse()



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

    now=A[i+k]-A[i]

    if now>ans:

        ans=now



print((ans/2))
n,k=list(map(int,input().split()))

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



for i in range(n-1):

    A[i+1]+=A[i]



ans=0.0

A.reverse()

A.append(0)

A.reverse()



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

    now=A[i+k]-A[i]

    if now>ans:

        ans=now



print(((ans+k)/2))
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
for i in range(n):
    A[i] += 1
for i in range(n - 1):
    A[i + 1] += A[i]
ans = 0.0
A.reverse()
A.append(0)
A.reverse()
for i in range(n - k + 1):
    now = A[i + k] - A[i]
    if now > ans:
        ans = now
print((ans / 2))

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
for i in range(n - 1):
    A[i + 1] += A[i]
ans = 0.0
A.reverse()
A.append(0)
A.reverse()
for i in range(n - k + 1):
    now = A[i + k] - A[i]
    if now > ans:
        ans = now
print(((ans + k) / 2))

-for i in range(n): -    A[i] += 1 -print((ans / 2)) +print(((ans + k) / 2))