class BIT:

    def __init__(self, n):

        self.node = [ 0 for _ in range(n+1) ]



    def add(self, idx, w):

        i = idx

        while i < len(self.node) - 1:

            self.node[i] += w

            i |= (i + 1)



    def sum_(self, idx):

        ret, i = 0, idx-1

        while i >= 0:

            ret += self.node[i]

            i = (i & (i + 1)) - 1

        return ret



    def sum(self, l, r):

        return self.sum_(r) - self.sum_(l)





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

tree = BIT(n)

p = [ int(x) for x in input().split() ]



for i in range(n):

    tree.add(i, (1+p[i])/2)



ans = 0

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

    ans = max(ans, tree.sum(i, i+k))



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

p = [int(x) for x in input().split()]

p = [(x + 1) / 2 for x in p]



S = [0 for _ in range(N + 1)]



for i in range(N):

    S[i + 1] += S[i] + p[i]



ans = 0

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

    ans = max(ans, S[i + K] - S[i])



print(ans)
class BIT:
    def __init__(self, n):
        self.node = [0 for _ in range(n + 1)]

    def add(self, idx, w):
        i = idx
        while i < len(self.node) - 1:
            self.node[i] += w
            i |= i + 1

    def sum_(self, idx):
        ret, i = 0, idx - 1
        while i >= 0:
            ret += self.node[i]
            i = (i & (i + 1)) - 1
        return ret

    def sum(self, l, r):
        return self.sum_(r) - self.sum_(l)


n, k = list(map(int, input().split()))
tree = BIT(n)
p = [int(x) for x in input().split()]
for i in range(n):
    tree.add(i, (1 + p[i]) / 2)
ans = 0
for i in range(n - k + 1):
    ans = max(ans, tree.sum(i, i + k))
print(ans)

N, K = list(map(int, input().split()))
p = [int(x) for x in input().split()]
p = [(x + 1) / 2 for x in p]
S = [0 for _ in range(N + 1)]
for i in range(N):
    S[i + 1] += S[i] + p[i]
ans = 0
for i in range(N - K + 1):
    ans = max(ans, S[i + K] - S[i])
print(ans)

-class BIT: -    def __init__(self, n): -        self.node = [0 for _ in range(n + 1)] - -    def add(self, idx, w): -        i = idx -        while i < len(self.node) - 1: -            self.node[i] += w -            i |= i + 1 - -    def sum_(self, idx): -        ret, i = 0, idx - 1 -        while i >= 0: -            ret += self.node[i] -            i = (i & (i + 1)) - 1 -        return ret - -    def sum(self, l, r): -        return self.sum_(r) - self.sum_(l) - - -n, k = list(map(int, input().split())) -tree = BIT(n) +N, K = list(map(int, input().split())) -for i in range(n): -    tree.add(i, (1 + p[i]) / 2) +p = [(x + 1) / 2 for x in p] +S = [0 for _ in range(N + 1)] +for i in range(N): +    S[i + 1] += S[i] + p[i] -for i in range(n - k + 1): -    ans = max(ans, tree.sum(i, i + k)) +for i in range(N - K + 1): +    ans = max(ans, S[i + K] - S[i])