#!/usr/bin/env python3
def main():
    def expected_val(limit):
        # return (1 + limit) / 2
        return sum(range(limit + 1)) / limit

    N, K = map(int, input().split())
    P = [int(x) for x in input().split()]

    lst = [0]
    res = 0
    for p in P:
        res += expected_val(p)
        lst.append(res)
    ans = 0
    for i in range(N - K + 1):
        res = lst[i + K] - lst[i]
        ans = res if res > ans else ans
    print(ans)


if __name__ == '__main__':
    main() def main():
    def expected_val(limit):
        # return (1 + limit) / 2
        return sum(range(limit + 1)) / limit

    N, K = map(int, input().split())
    P = [int(x) for x in input().split()]

    lst = [0]
    res = 0
    for p in P:
        res += expected_val(p)
        lst.append(res)
    ans = 0
    for i in range(N - K + 1):
        res = lst[i + K] - lst[i]
        ans = res if res > ans else ans
    print(ans) main def expected_val(limit):
        # return (1 + limit) / 2
        return sum(range(limit + 1)) / limit

     expected_val return sum(range(limit + 1)) / limit sum(range(limit + 1)) / limit sum(range(limit + 1)) sum range(limit + 1) range limit + 1 limit 1 limit limit limit N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x P = [int(x) for x in input().split()] P [int(x) for x in input().split()] lst = [0] lst [0] 0 res = 0 res 0 for p in P:
        res += expected_val(p)
        lst.append(res)
     p P res += expected_val(p) res expected_val(p) expected_val p lst.append(res) lst.append lst append res ans = 0 ans 0 for i in range(N - K + 1):
        res = lst[i + K] - lst[i]
        ans = res if res > ans else ans
     i range(N - K + 1) range N - K + 1 N - K N K 1 res = lst[i + K] - lst[i] res lst[i + K] - lst[i] lst[i + K] lst i + K i K lst[i] lst i ans = res if res > ans else ans ans res if res > ans else ans res > ans res ans res ans print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    def expected_val(limit):
        # return (1 + limit) / 2
        return sum(range(limit + 1)) / limit

    N, K = map(int, input().split())
    P = [int(x) for x in input().split()]

    lst = [0]
    res = 0
    for p in P:
        res += expected_val(p)
        lst.append(res)
    ans = 0
    for i in range(N - K + 1):
        res = lst[i + K] - lst[i]
        ans = res if res > ans else ans
    print(ans) def main():
    def expected_val(limit):
        # return (1 + limit) / 2
        return sum(range(limit + 1)) / limit

    N, K = map(int, input().split())
    P = [int(x) for x in input().split()]

    lst = [0]
    res = 0
    for p in P:
        res += expected_val(p)
        lst.append(res)
    ans = 0
    for i in range(N - K + 1):
        res = lst[i + K] - lst[i]
        ans = res if res > ans else ans
    print(ans) main
#!/usr/bin/env python3
def main():
    def expected_val(limit):
        # return (1 + limit) / 2
        return sum(range(limit + 1)) / limit

    N, K = map(int, input().split())
    P = [int(x) for x in input().split()]

    lst = [0]
    res = 0
    for p in P:
        res += expected_val(p)
        lst.append(res)
    ans = 0
    for i in range(N - K + 1):
        res = lst[i + K] - lst[i]
        ans = res if res > ans else ans
    print(ans)


if __name__ == '__main__':
    main()
