from collections import deque



if __name__ == '__main__':

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

    p = list(map(int, input().split(" ")))



    d = deque([0])

    for i in range(n):

        d.append(d[i] + p[i])



    # print(d)



    max_sum = 0

    rangeN = n - k + 1



    for i in range(rangeN):

        sum_d = d[i + k] - d[i]

        if max_sum < sum_d:

            max_sum = sum_d

    # print(max_sum)



    # r_array = [sum(p[i:i + k]) for i in range(rangeN)]

    print(((max_sum + k) / 2))

if __name__ == '__main__':

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

    p = list(map(int, input().split(" ")))



    # d = deque([0])

    d = [0]

    for i in range(n):

        d.append(d[i] + p[i])



    # print(d)



    max_sum = 0

    rangeN = n - k + 1



    for i in range(rangeN):

        sum_d = d[i + k] - d[i]

        if max_sum < sum_d:

            max_sum = sum_d

    # print(max_sum)



    # r_array = [sum(p[i:i + k]) for i in range(rangeN)]

    print(((max_sum + k) / 2))
from collections import deque

if __name__ == "__main__":
    n, k = list(map(int, input().split(" ")))
    p = list(map(int, input().split(" ")))
    d = deque([0])
    for i in range(n):
        d.append(d[i] + p[i])
    # print(d)
    max_sum = 0
    rangeN = n - k + 1
    for i in range(rangeN):
        sum_d = d[i + k] - d[i]
        if max_sum < sum_d:
            max_sum = sum_d
    # print(max_sum)
    # r_array = [sum(p[i:i + k]) for i in range(rangeN)]
    print(((max_sum + k) / 2))

if __name__ == "__main__":
    n, k = list(map(int, input().split(" ")))
    p = list(map(int, input().split(" ")))
    # d = deque([0])
    d = [0]
    for i in range(n):
        d.append(d[i] + p[i])
    # print(d)
    max_sum = 0
    rangeN = n - k + 1
    for i in range(rangeN):
        sum_d = d[i + k] - d[i]
        if max_sum < sum_d:
            max_sum = sum_d
    # print(max_sum)
    # r_array = [sum(p[i:i + k]) for i in range(rangeN)]
    print(((max_sum + k) / 2))

-from collections import deque - -    d = deque([0]) +    # d = deque([0]) +    d = [0]