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

#logging.debug("デバッグスタート") #
l = [[] for i in range(n)]#期待値
m = [[] for i in range(n - k + 1)]  #k個の合計

for i in range(n):
    l[i] = (1 + p[i]) / 2

#logging.debug("l = {}".format(l))#
m[0] = sum(l[0:k])
ans = m[0]

for i in range(1, n - k + 1):
    #logging.debug("m[i-1] = {} ,l[i-1] = {} ,l[i+k] = {}".format(m[i - 1], l[i - 1], l[i + k - 1]))  #
    m[i] = m[i - 1] - l[i - 1] + l[i + k - 1]
    if m[i] > ans:
        ans = m[i]

#logging.debug(m)#
print(ans) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k p = list(map(int, input().split())) p list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split [] for i in range(n) for i in range(n) i range(n) range n for i in range(n) [] l = [[] for i in range(n)] l [[] for i in range(n)] [] for i in range(n - k + 1) for i in range(n - k + 1) i range(n - k + 1) range n - k + 1 n - k n k 1 for i in range(n - k + 1) [] m = [[] for i in range(n - k + 1)] m [[] for i in range(n - k + 1)] for i in range(n):
    l[i] = (1 + p[i]) / 2

#logging.debug("l = {}".format(l))# i range(n) range n l[i] = (1 + p[i]) / 2 l[i] l i (1 + p[i]) / 2 1 + p[i] 1 p[i] p i 2 m[0] = sum(l[0:k]) m[0] m 0 sum(l[0:k]) sum l[0:k] l 0:k 0 k ans = m[0] ans m[0] m 0 for i in range(1, n - k + 1):
    #logging.debug("m[i-1] = {} ,l[i-1] = {} ,l[i+k] = {}".format(m[i - 1], l[i - 1], l[i + k - 1]))  #
    m[i] = m[i - 1] - l[i - 1] + l[i + k - 1]
    if m[i] > ans:
        ans = m[i]

#logging.debug(m)# i range(1, n - k + 1) range 1 n - k + 1 n - k n k 1 m[i] = m[i - 1] - l[i - 1] + l[i + k - 1] m[i] m i m[i - 1] - l[i - 1] + l[i + k - 1] m[i - 1] - l[i - 1] m[i - 1] m i - 1 i 1 l[i - 1] l i - 1 i 1 l[i + k - 1] l i + k - 1 i + k i k 1 if m[i] > ans:
        ans = m[i]

#logging.debug(m)# m[i] > ans m[i] m i ans ans = m[i] ans m[i] m i print(ans) print ans p = list(map(int, input().split())) list(map(int, input().split())) p m = [[] for i in range(n - k + 1)] [[] for i in range(n - k + 1)] m n, k = map(int, input().split()) map(int, input().split()) n l = [[] for i in range(n)] [[] for i in range(n)] l k = map(int, input().split()) map(int, input().split()) k ans = m[i] m[i] ans ans = m[0] m[0] ans
n, k = map(int, input().split())
p = list(map(int, input().split()))

#logging.debug("デバッグスタート") #
l = [[] for i in range(n)]#期待値
m = [[] for i in range(n - k + 1)]  #k個の合計

for i in range(n):
    l[i] = (1 + p[i]) / 2

#logging.debug("l = {}".format(l))#
m[0] = sum(l[0:k])
ans = m[0]

for i in range(1, n - k + 1):
    #logging.debug("m[i-1] = {} ,l[i-1] = {} ,l[i+k] = {}".format(m[i - 1], l[i - 1], l[i + k - 1]))  #
    m[i] = m[i - 1] - l[i - 1] + l[i + k - 1]
    if m[i] > ans:
        ans = m[i]

#logging.debug(m)#
print(ans)