# 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([0] + [(i + 1) / 2 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([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([0] + [(i + 1) / 2 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([0] + [i * (1 + i) / (2 * i) for i in P])) +    cumsum = tuple(accumulate([0] + [(i + 1) / 2 for i in P]))