class SegmentTree:

    seg_len = 1

    node = []

    def __init__(self, n):

        while self.seg_len < n:

            self.seg_len <<= 1

        self.node = [ 0 for _ in range(self.seg_len*2) ]



    def add(self, idx, v):

        idx += self.seg_len

        self.node[idx] += v

        while True:

            idx //= 2

            if idx == 0:

                break

            self.node[idx] = self.node[idx*2] + self.node[idx*2+1]



    def sum(self, l, r):

        l += self.seg_len

        r += self.seg_len

        ret = 0

        while l < r:

            if l & 1 == 1:

                ret += self.node[l]

                l += 1

            if r & 1 == 1:

                ret += self.node[r-1]

                r -= 1

            l //= 2; r //= 2;

        return ret





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

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



seg_tree = SegmentTree(n)

for i in range(n):

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



ans = 0

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

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



print(ans)

class SegmentTree:

    seg_len = 1

    node = []

    def __init__(self, n):

        while self.seg_len < n:

            self.seg_len <<= 1

        self.node = [ 0 for _ in range(self.seg_len*2) ]



    def add(self, idx, v):

        idx += self.seg_len

        self.node[idx] += v

        while True:

            idx >>= 1

            if idx == 0:

                break

            self.node[idx] = self.node[idx*2] + self.node[idx*2+1]



    def sum(self, l, r):

        l += self.seg_len

        r += self.seg_len

        ret = 0

        while l < r:

            if l & 1 == 1:

                ret += self.node[l]

                l += 1

            if r & 1 == 1:

                ret += self.node[r-1]

                r -= 1

            l >>= 1; r >>= 1;

        return ret





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

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



seg_tree = SegmentTree(n)

for i in range(n):

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



ans = 0

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

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



print(ans)

class SegmentTree:
    seg_len = 1
    node = []

    def __init__(self, n):
        while self.seg_len < n:
            self.seg_len <<= 1
        self.node = [0 for _ in range(self.seg_len * 2)]

    def add(self, idx, v):
        idx += self.seg_len
        self.node[idx] += v
        while True:
            idx //= 2
            if idx == 0:
                break
            self.node[idx] = self.node[idx * 2] + self.node[idx * 2 + 1]

    def sum(self, l, r):
        l += self.seg_len
        r += self.seg_len
        ret = 0
        while l < r:
            if l & 1 == 1:
                ret += self.node[l]
                l += 1
            if r & 1 == 1:
                ret += self.node[r - 1]
                r -= 1
            l //= 2
            r //= 2
        return ret


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

class SegmentTree:
    seg_len = 1
    node = []

    def __init__(self, n):
        while self.seg_len < n:
            self.seg_len <<= 1
        self.node = [0 for _ in range(self.seg_len * 2)]

    def add(self, idx, v):
        idx += self.seg_len
        self.node[idx] += v
        while True:
            idx >>= 1
            if idx == 0:
                break
            self.node[idx] = self.node[idx * 2] + self.node[idx * 2 + 1]

    def sum(self, l, r):
        l += self.seg_len
        r += self.seg_len
        ret = 0
        while l < r:
            if l & 1 == 1:
                ret += self.node[l]
                l += 1
            if r & 1 == 1:
                ret += self.node[r - 1]
                r -= 1
            l >>= 1
            r >>= 1
        return ret


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

-            idx //= 2 +            idx >>= 1 -            l //= 2 -            r //= 2 +            l >>= 1 +            r >>= 1