

def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    """
    1 2
    /2 = 1.5

    1 2 3 4
    /4 = 2.5

    1 2 3 4 5
    /5 = 3
    """
    N, K = read_ints()
    expectations = [(p+1)/2 for p in read_ints()]
    max_e = current = sum(expectations[:K])
    for i in range(1, N-K+1):
        # remove i-1 add i+K
        current = current-expectations[i-1]+expectations[i+K-1]
        max_e = max(max_e, current)
    return max_e


if __name__ == '__main__':
    print(solve()) def read_int():
    return int(input().strip()) read_int return int(input().strip()) int(input().strip()) int input().strip() ().strip () input strip def read_ints():
    return list(map(int, input().strip().split(' '))) read_ints return list(map(int, input().strip().split(' '))) list(map(int, input().strip().split(' '))) list map(int, input().strip().split(' ')) map int input().strip().split(' ') ().strip().split ().strip() ().strip () input strip split ' ' def solve():
    """
    1 2
    /2 = 1.5

    1 2 3 4
    /4 = 2.5

    1 2 3 4 5
    /5 = 3
    """
    N, K = read_ints()
    expectations = [(p+1)/2 for p in read_ints()]
    max_e = current = sum(expectations[:K])
    for i in range(1, N-K+1):
        # remove i-1 add i+K
        current = current-expectations[i-1]+expectations[i+K-1]
        max_e = max(max_e, current)
    return max_e solve """
    1 2
    /2 = 1.5

    1 2 3 4
    /4 = 2.5

    1 2 3 4 5
    /5 = 3
    """ N, K = read_ints() N read_ints() read_ints K (p+1)/2 for p in read_ints() for p in read_ints() p read_ints() read_ints for p in read_ints() (p+1)/2 p+1 p 1 2 expectations = [(p+1)/2 for p in read_ints()] expectations [(p+1)/2 for p in read_ints()] max_e = current = sum(expectations[:K]) max_e sum(expectations[:K]) sum expectations[:K] expectations :K K = current = sum(expectations[:K]) current sum(expectations[:K]) for i in range(1, N-K+1):
        # remove i-1 add i+K
        current = current-expectations[i-1]+expectations[i+K-1]
        max_e = max(max_e, current)
     i range(1, N-K+1) range 1 N-K+1 N-K N K 1 current = current-expectations[i-1]+expectations[i+K-1] current current-expectations[i-1]+expectations[i+K-1] current-expectations[i-1] current expectations[i-1] expectations i-1 i 1 expectations[i+K-1] expectations i+K-1 i+K i K 1 max_e = max(max_e, current) max_e max(max_e, current) max max_e current return max_e max_e if __name__ == '__main__':
    print(solve()) __name__ == '__main__' __name__ '__main__' print(solve()) print solve() solve def solve():
    """
    1 2
    /2 = 1.5

    1 2 3 4
    /4 = 2.5

    1 2 3 4 5
    /5 = 3
    """
    N, K = read_ints()
    expectations = [(p+1)/2 for p in read_ints()]
    max_e = current = sum(expectations[:K])
    for i in range(1, N-K+1):
        # remove i-1 add i+K
        current = current-expectations[i-1]+expectations[i+K-1]
        max_e = max(max_e, current)
    return max_e def solve():
    """
    1 2
    /2 = 1.5

    1 2 3 4
    /4 = 2.5

    1 2 3 4 5
    /5 = 3
    """
    N, K = read_ints()
    expectations = [(p+1)/2 for p in read_ints()]
    max_e = current = sum(expectations[:K])
    for i in range(1, N-K+1):
        # remove i-1 add i+K
        current = current-expectations[i-1]+expectations[i+K-1]
        max_e = max(max_e, current)
    return max_e solve def read_ints():
    return list(map(int, input().strip().split(' '))) def read_ints():
    return list(map(int, input().strip().split(' '))) read_ints def read_int():
    return int(input().strip()) def read_int():
    return int(input().strip()) read_int


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    """
    1 2
    /2 = 1.5

    1 2 3 4
    /4 = 2.5

    1 2 3 4 5
    /5 = 3
    """
    N, K = read_ints()
    expectations = [(p+1)/2 for p in read_ints()]
    max_e = current = sum(expectations[:K])
    for i in range(1, N-K+1):
        # remove i-1 add i+K
        current = current-expectations[i-1]+expectations[i+K-1]
        max_e = max(max_e, current)
    return max_e


if __name__ == '__main__':
    print(solve())
