def main():

    from itertools import accumulate

    n, k = list(map(int, input().split()))

    *exp, = [(int(x) + 1) / 2 for x in input().split()]

    l = accumulate(exp)

    l = list(l)

    ll = [l[k - 1]] + [l[i + k] - l[i] for i in range(n-k)]

    ans = max(ll)

    print(ans)





if __name__ == '__main__':

    main()

def main():

    from itertools import accumulate

    n, k = list(map(int, input().split()))

    *exp, = [(int(x) + 1) / 2 for x in input().split()]

    l = accumulate(exp)

    l = list(l)

    ll = [l[k - 1]] + [j - i for i, j in zip(l, l[k:])]

    ans = max(ll)

    print(ans)





if __name__ == '__main__':

    main()

def main():
    from itertools import accumulate

    n, k = list(map(int, input().split()))
    (*exp,) = [(int(x) + 1) / 2 for x in input().split()]
    l = accumulate(exp)
    l = list(l)
    ll = [l[k - 1]] + [l[i + k] - l[i] for i in range(n - k)]
    ans = max(ll)
    print(ans)


if __name__ == "__main__":
    main()

def main():
    from itertools import accumulate

    n, k = list(map(int, input().split()))
    (*exp,) = [(int(x) + 1) / 2 for x in input().split()]
    l = accumulate(exp)
    l = list(l)
    ll = [l[k - 1]] + [j - i for i, j in zip(l, l[k:])]
    ans = max(ll)
    print(ans)


if __name__ == "__main__":
    main()

-    ll = [l[k - 1]] + [l[i + k] - l[i] for i in range(n - k)] +    ll = [l[k - 1]] + [j - i for i, j in zip(l, l[k:])]