def d_dice_in_line():

    N, K = [int(i) for i in input().split()]

    P = [int(i) for i in input().split()]



    def experience(x):

        return (x + 1) / 2  # 1からxまで出るサイコロの出目の期待値



    ans = []

    tmp = 0

    for i in range(K):

        tmp += experience(P[i])

    ans.append(tmp)

    for i in range(K, N):

        tmp -= experience(P[i - K])

        tmp += experience(P[i])

        ans.append(tmp)

    return max(ans)



print((d_dice_in_line()))
def d_dice_in_line():

    from itertools import accumulate

    N, K = [int(i) for i in input().split()]

    P = [int(i) for i in input().split()]



    expected_value = [0] + [(p + 1) / 2 for p in P]

    cumsum = list(accumulate(expected_value))

    return max([cumsum[j + K] - cumsum[j] for j in range(N - K + 1)])



print((d_dice_in_line()))
def d_dice_in_line():
    N, K = [int(i) for i in input().split()]
    P = [int(i) for i in input().split()]

    def experience(x):
        return (x + 1) / 2  # 1からxまで出るサイコロの出目の期待値

    ans = []
    tmp = 0
    for i in range(K):
        tmp += experience(P[i])
    ans.append(tmp)
    for i in range(K, N):
        tmp -= experience(P[i - K])
        tmp += experience(P[i])
        ans.append(tmp)
    return max(ans)


print((d_dice_in_line()))

def d_dice_in_line():
    from itertools import accumulate

    N, K = [int(i) for i in input().split()]
    P = [int(i) for i in input().split()]
    expected_value = [0] + [(p + 1) / 2 for p in P]
    cumsum = list(accumulate(expected_value))
    return max([cumsum[j + K] - cumsum[j] for j in range(N - K + 1)])


print((d_dice_in_line()))

+    from itertools import accumulate + - -    def experience(x): -        return (x + 1) / 2  # 1からxまで出るサイコロの出目の期待値 - -    ans = [] -    tmp = 0 -    for i in range(K): -        tmp += experience(P[i]) -    ans.append(tmp) -    for i in range(K, N): -        tmp -= experience(P[i - K]) -        tmp += experience(P[i]) -        ans.append(tmp) -    return max(ans) +    expected_value = [0] + [(p + 1) / 2 for p in P] +    cumsum = list(accumulate(expected_value)) +    return max([cumsum[j + K] - cumsum[j] for j in range(N - K + 1)])