def main(n,k,p):

    res = 0

    #期待値リスト

    kitai = [0] * n

    ruiseki = [0] * n

    kitai[0] = (p[0] + 1) / 2

    ruiseki[0] = kitai[0]

    if n == 1:

        return kitai[0]

    else:

        for i in range(1, len(p)):

            kitai[i] = (p[i] + 1) / 2

            ruiseki[i] = ruiseki[i-1] + kitai[i]

    for i in range(k-1, len(ruiseki)):

        res = max(res, ruiseki[i] - (ruiseki[i-k] if (i-k) >= 0 else 0))

    return res





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

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

print((main(n,k,p)))
def main2(n,k,p):

    maxVal = 0

    #期待値リスト

    kitai = [0] * n

    for i in range(n):

        kitai[i] = (p[i] + 1) / 2

    #先頭からK個の合計

    val = sum(kitai[:k])

    #kとnが同じ場合return

    if k == n:

        return val

    for i in range(k,n):

        #次の値は現在のvalにkitai[i]を足して、kitai[i-k]を引いた値

        val = val + kitai[i] - kitai[i-k]

        maxVal = max(maxVal, val)

    return maxVal



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

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

print((main2(n,k,p)))
def main(n, k, p):
    res = 0
    # 期待値リスト
    kitai = [0] * n
    ruiseki = [0] * n
    kitai[0] = (p[0] + 1) / 2
    ruiseki[0] = kitai[0]
    if n == 1:
        return kitai[0]
    else:
        for i in range(1, len(p)):
            kitai[i] = (p[i] + 1) / 2
            ruiseki[i] = ruiseki[i - 1] + kitai[i]
    for i in range(k - 1, len(ruiseki)):
        res = max(res, ruiseki[i] - (ruiseki[i - k] if (i - k) >= 0 else 0))
    return res


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

def main2(n, k, p):
    maxVal = 0
    # 期待値リスト
    kitai = [0] * n
    for i in range(n):
        kitai[i] = (p[i] + 1) / 2
    # 先頭からK個の合計
    val = sum(kitai[:k])
    # kとnが同じ場合return
    if k == n:
        return val
    for i in range(k, n):
        # 次の値は現在のvalにkitai[i]を足して、kitai[i-k]を引いた値
        val = val + kitai[i] - kitai[i - k]
        maxVal = max(maxVal, val)
    return maxVal


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

-def main(n, k, p): -    res = 0 +def main2(n, k, p): +    maxVal = 0 -    ruiseki = [0] * n -    kitai[0] = (p[0] + 1) / 2 -    ruiseki[0] = kitai[0] -    if n == 1: -        return kitai[0] -    else: -        for i in range(1, len(p)): -            kitai[i] = (p[i] + 1) / 2 -            ruiseki[i] = ruiseki[i - 1] + kitai[i] -    for i in range(k - 1, len(ruiseki)): -        res = max(res, ruiseki[i] - (ruiseki[i - k] if (i - k) >= 0 else 0)) -    return res +    for i in range(n): +        kitai[i] = (p[i] + 1) / 2 +    # 先頭からK個の合計 +    val = sum(kitai[:k]) +    # kとnが同じ場合return +    if k == n: +        return val +    for i in range(k, n): +        # 次の値は現在のvalにkitai[i]を足して、kitai[i-k]を引いた値 +        val = val + kitai[i] - kitai[i - k] +        maxVal = max(maxVal, val) +    return maxVal -print((main(n, k, p))) +print((main2(n, k, p)))