def main():

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

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

    E = [(p*(p+1)//2)/p for p in P]

    S = [0]*(N+1)

    ma = 0

    for i in range(N):

        S[i+1] = S[i] + E[i]

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

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

    print(ma)





if __name__ == '__main__':

    main()

def main():

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

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

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

    from itertools import accumulate

    S = list(accumulate([0] + B))

    # print(B, S)

    ans = 0

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

        cur = S[i+K] - S[i]

        ans = max(ans, cur)

    print(ans)





if __name__ == '__main__':

    main()

def main():
    N, K = (int(i) for i in input().split())
    P = [int(i) for i in input().split()]
    E = [(p * (p + 1) // 2) / p for p in P]
    S = [0] * (N + 1)
    ma = 0
    for i in range(N):
        S[i + 1] = S[i] + E[i]
    for i in range(N - K + 1):
        ma = max(ma, S[K + i] - S[i])
    print(ma)


if __name__ == "__main__":
    main()

def main():
    N, K = (int(i) for i in input().split())
    P = [int(i) for i in input().split()]
    B = [(p + 1) / 2 for p in P]
    from itertools import accumulate

    S = list(accumulate([0] + B))
    # print(B, S)
    ans = 0
    for i in range(N - K + 1):
        cur = S[i + K] - S[i]
        ans = max(ans, cur)
    print(ans)


if __name__ == "__main__":
    main()

-    E = [(p * (p + 1) // 2) / p for p in P] -    S = [0] * (N + 1) -    ma = 0 -    for i in range(N): -        S[i + 1] = S[i] + E[i] +    B = [(p + 1) / 2 for p in P] +    from itertools import accumulate + +    S = list(accumulate([0] + B)) +    # print(B, S) +    ans = 0 -        ma = max(ma, S[K + i] - S[i]) -    print(ma) +        cur = S[i + K] - S[i] +        ans = max(ans, cur) +    print(ans)