import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline



def main():

    N, K, *p = list(map(int, read().split()))

    p = list([(x+1)*0.5 for x in p])

    p_sum = []

    p_sum.append(p[0])

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

        p_sum.append(p_sum[i-1] + p[i])

    result = p_sum[K-1]

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

        result = max(result,p_sum[K-1+i] -p_sum[i-1])

    return result



if __name__ == '__main__':

    print((main()))



def main():

  from itertools import accumulate

  import sys

  read = sys.stdin.buffer.read

  N, K, *p = list(map(int, read().split()))

  p = [0] + list(accumulate(p))

  print(((max(y - x for x, y in zip(p, p[K:])) + K) / 2))



if __name__ == '__main__':

    main()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline


def main():
    N, K, *p = list(map(int, read().split()))
    p = list([(x + 1) * 0.5 for x in p])
    p_sum = []
    p_sum.append(p[0])
    for i in range(1, len(p)):
        p_sum.append(p_sum[i - 1] + p[i])
    result = p_sum[K - 1]
    for i in range(1, N - K + 1):
        result = max(result, p_sum[K - 1 + i] - p_sum[i - 1])
    return result


if __name__ == "__main__":
    print((main()))

def main():
    from itertools import accumulate
    import sys

    read = sys.stdin.buffer.read
    N, K, *p = list(map(int, read().split()))
    p = [0] + list(accumulate(p))
    print(((max(y - x for x, y in zip(p, p[K:])) + K) / 2))


if __name__ == "__main__":
    main()

-import sys +def main(): +    from itertools import accumulate +    import sys -read = sys.stdin.buffer.read -readline = sys.stdin.buffer.readline - - -def main(): +    read = sys.stdin.buffer.read -    p = list([(x + 1) * 0.5 for x in p]) -    p_sum = [] -    p_sum.append(p[0]) -    for i in range(1, len(p)): -        p_sum.append(p_sum[i - 1] + p[i]) -    result = p_sum[K - 1] -    for i in range(1, N - K + 1): -        result = max(result, p_sum[K - 1 + i] - p_sum[i - 1]) -    return result +    p = [0] + list(accumulate(p)) +    print(((max(y - x for x, y in zip(p, p[K:])) + K) / 2)) -    print((main())) +    main()