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

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



cuml=[]

cum=0

for i in range(n):

    cum+=(pl[i]+1)/2

    cuml.append(cum)

mx=0

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

    if i==0:

        mx=max(cuml[i+k-1],mx)

    else:

        mx=max(cuml[i+k-1]-cuml[i-1],mx)

print(('{:.9f}'.format(mx)))

#n=int(input())

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

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

#l=[list(map(int,input().split())) for i in range(n)]



expl=[0.0]

ansl=[]

cum=0

for i in range(n):

    cum+=(1+pl[i])/2

    expl.append(cum)



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

    ansl.append(expl[i+k]-expl[i])



print(('{:.9f}'.format(max(ansl))))
n, k = list(map(int, input().split()))
pl = list(map(int, input().split()))
cuml = []
cum = 0
for i in range(n):
    cum += (pl[i] + 1) / 2
    cuml.append(cum)
mx = 0
for i in range(n - (k - 1)):
    if i == 0:
        mx = max(cuml[i + k - 1], mx)
    else:
        mx = max(cuml[i + k - 1] - cuml[i - 1], mx)
print(("{:.9f}".format(mx)))

# n=int(input())
n, k = list(map(int, input().split()))
pl = list(map(int, input().split()))
# l=[list(map(int,input().split())) for i in range(n)]
expl = [0.0]
ansl = []
cum = 0
for i in range(n):
    cum += (1 + pl[i]) / 2
    expl.append(cum)
for i in range(n - k + 1):
    ansl.append(expl[i + k] - expl[i])
print(("{:.9f}".format(max(ansl))))

+# n=int(input()) -cuml = [] +# l=[list(map(int,input().split())) for i in range(n)] +expl = [0.0] +ansl = [] -    cum += (pl[i] + 1) / 2 -    cuml.append(cum) -mx = 0 -for i in range(n - (k - 1)): -    if i == 0: -        mx = max(cuml[i + k - 1], mx) -    else: -        mx = max(cuml[i + k - 1] - cuml[i - 1], mx) -print(("{:.9f}".format(mx))) +    cum += (1 + pl[i]) / 2 +    expl.append(cum) +for i in range(n - k + 1): +    ansl.append(expl[i + k] - expl[i]) +print(("{:.9f}".format(max(ansl))))