# D - Dice in Line

from itertools import accumulate





def main():

    N, K, *P = list(map(int, open(0).read().split()))

    # cumsum[i] = cumulative sum of expected values in [0, i]

    cumsum = tuple(accumulate(i * (1 + i) / (2 * i) for i in P))

    if N == K:

        print((cumsum[-1]))

        return

    ans = 0

    for i in range(N - K):

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

    print(ans)





if __name__ == "__main__":

    main()

# D - Dice in Line

from itertools import accumulate





def main():

    N, K, *P = list(map(int, open(0).read().split()))

    # cumsum[i] = cumulative sum of expected values in [0, i]

    cumsum = tuple(accumulate([0] + [i * (1 + i) / (2 * i) for i in P]))

    ans = max(right - left for left, right in zip(cumsum, cumsum[K:]))

    print(ans)





if __name__ == "__main__":

    main()

# D - Dice in Line
from itertools import accumulate


def main():
    N, K, *P = list(map(int, open(0).read().split()))
    # cumsum[i] = cumulative sum of expected values in [0, i]
    cumsum = tuple(accumulate(i * (1 + i) / (2 * i) for i in P))
    if N == K:
        print((cumsum[-1]))
        return
    ans = 0
    for i in range(N - K):
        ans = max(ans, cumsum[i + K] - cumsum[i])
    print(ans)


if __name__ == "__main__":
    main()

# D - Dice in Line
from itertools import accumulate


def main():
    N, K, *P = list(map(int, open(0).read().split()))
    # cumsum[i] = cumulative sum of expected values in [0, i]
    cumsum = tuple(accumulate([0] + [i * (1 + i) / (2 * i) for i in P]))
    ans = max(right - left for left, right in zip(cumsum, cumsum[K:]))
    print(ans)


if __name__ == "__main__":
    main()

-    cumsum = tuple(accumulate(i * (1 + i) / (2 * i) for i in P)) -    if N == K: -        print((cumsum[-1])) -        return -    ans = 0 -    for i in range(N - K): -        ans = max(ans, cumsum[i + K] - cumsum[i]) +    cumsum = tuple(accumulate([0] + [i * (1 + i) / (2 * i) for i in P])) +    ans = max(right - left for left, right in zip(cumsum, cumsum[K:]))