N, K = list(map(int, input().split()))

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

lst = [0]

for x in P:

  lst.append(lst[-1] + (x+1)/2)



res = -1

for i in range(N-K+1):

  sum = lst[i+K]-lst[i]

  res = max(res, sum)



print(("{:.6f}".format(res)))

 
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



import numpy as np



data = np.fromstring(read(), np.int64, sep=' ')



N, K  = data[:2]

P = np.hstack([[0], data[2:] + 1])



Pcum = P.cumsum()

x = Pcum[K:] - Pcum[0:-K]

print((x.max() / 2))

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
lst = [0]
for x in P:
    lst.append(lst[-1] + (x + 1) / 2)
res = -1
for i in range(N - K + 1):
    sum = lst[i + K] - lst[i]
    res = max(res, sum)
print(("{:.6f}".format(res)))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

data = np.fromstring(read(), np.int64, sep=" ")
N, K = data[:2]
P = np.hstack([[0], data[2:] + 1])
Pcum = P.cumsum()
x = Pcum[K:] - Pcum[0:-K]
print((x.max() / 2))

-N, K = list(map(int, input().split())) -P = list(map(int, input().split())) -lst = [0] -for x in P: -    lst.append(lst[-1] + (x + 1) / 2) -res = -1 -for i in range(N - K + 1): -    sum = lst[i + K] - lst[i] -    res = max(res, sum) -print(("{:.6f}".format(res))) +import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +import numpy as np + +data = np.fromstring(read(), np.int64, sep=" ") +N, K = data[:2] +P = np.hstack([[0], data[2:] + 1]) +Pcum = P.cumsum() +x = Pcum[K:] - Pcum[0:-K] +print((x.max() / 2))