





'''simple docstring'''


_SCREAMING_SNAKE_CASE									=				{0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

_SCREAMING_SNAKE_CASE									=				{0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}


def 						__a(SCREAMING_SNAKE_CASE_	:       dict[int, list[int]]		,							SCREAMING_SNAKE_CASE_	:       int		,							SCREAMING_SNAKE_CASE_	:       list[bool]     ):



    '''simple docstring'''





    _lowerCAmelCase						      =   True
    _lowerCAmelCase						      =   []

    for neighbour in graph[vert]:
        if not visited[neighbour]:
            order += topology_sort(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )

    order.append(SCREAMING_SNAKE_CASE_     )

    return order


def 						__a(SCREAMING_SNAKE_CASE_	:       dict[int, list[int]]		,							SCREAMING_SNAKE_CASE_	:       int		,							SCREAMING_SNAKE_CASE_	:       list[bool]     ):



    '''simple docstring'''





    _lowerCAmelCase						      =   True
    _lowerCAmelCase						      =   [vert]

    for neighbour in reversed_graph[vert]:
        if not visited[neighbour]:
            component += find_components(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )

    return component





def 						__a(SCREAMING_SNAKE_CASE_	:       dict[int, list[int]]     ):



    '''simple docstring'''





    _lowerCAmelCase						      =   len(SCREAMING_SNAKE_CASE_     ) * [False]
    _lowerCAmelCase						      =   {vert: [] for vert in range(len(SCREAMING_SNAKE_CASE_     )     )}

    for vert, neighbours in graph.items():
        for neighbour in neighbours:
            reversed_graph[neighbour].append(SCREAMING_SNAKE_CASE_     )

    _lowerCAmelCase						      =   []
    for i, was_visited in enumerate(SCREAMING_SNAKE_CASE_     ):
        if not was_visited:
            order += topology_sort(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )

    _lowerCAmelCase						      =   []
    _lowerCAmelCase						      =   len(SCREAMING_SNAKE_CASE_     ) * [False]

    for i in range(len(SCREAMING_SNAKE_CASE_     )     ):
        _lowerCAmelCase						      =   order[len(SCREAMING_SNAKE_CASE_     ) - i - 1]
        if not visited[vert]:
            _lowerCAmelCase						      =   find_components(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )
            components_list.append(SCREAMING_SNAKE_CASE_     )

    return components_list









'''simple docstring'''


from __future__ import annotations


def 						__a(SCREAMING_SNAKE_CASE_	:       list     ):



    '''simple docstring'''





    if not nums:
        raise ValueError("List is empty"     )
    return sum(SCREAMING_SNAKE_CASE_     ) / len(SCREAMING_SNAKE_CASE_     )


if __name__ == "__main__":
       import doctest

       doctest.testmod()


