def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					list[list[int]]   ):







    '''simple docstring'''
    if len(__SCREAMING_SNAKE_CASE   ) == 0 or not all(len(__SCREAMING_SNAKE_CASE   ) == 2 for pair in coordinates   ):
        raise ValueError("""The program cannot work out a fitting polynomial."""   )

    if len({tuple(__SCREAMING_SNAKE_CASE   ) for pair in coordinates}   ) != len(__SCREAMING_SNAKE_CASE   ):
        raise ValueError("""The program cannot work out a fitting polynomial."""   )

    __snake_case       :				Union[str, Any] 			=    {x for x, _ in coordinates}
    if len(__SCREAMING_SNAKE_CASE   ) == 1:
        return F'''x={coordinates[0][0]}'''

    if len(__SCREAMING_SNAKE_CASE   ) != len(__SCREAMING_SNAKE_CASE   ):
        raise ValueError("""The program cannot work out a fitting polynomial."""   )

    __snake_case       :				Tuple 			=    len(__SCREAMING_SNAKE_CASE   )

    __snake_case       :				Optional[Any] 			=    0
    __snake_case       :				list[list[float]] 			=    []
    # put the x and x to the power values in a matrix
    while count_of_line < x:
        __snake_case       :				Any 			=    0
        __snake_case       :				List[Any] 			=    coordinates[count_of_line][0]
        __snake_case       :				list[float] 			=    []
        while count_in_line < x:
            count_line.append(a ** (x - (count_in_line + 1))   )
            count_in_line += 1
        matrix.append(__SCREAMING_SNAKE_CASE   )
        count_of_line += 1

    __snake_case       :				Tuple 			=    0
    # put the y values into a vector
    __snake_case       :				list[float] 			=    []
    while count_of_line < x:
        vector.append(coordinates[count_of_line][1]   )
        count_of_line += 1

    __snake_case       :				Optional[int] 			=    0

    while count < x:
        __snake_case       :				Optional[Any] 			=    0
        while zahlen < x:
            if count == zahlen:
                zahlen += 1
            if zahlen == x:
                break
            __snake_case       :				int 			=    matrix[zahlen][count] / matrix[count][count]
            for counting_columns, item in enumerate(matrix[count]   ):
                # manipulating all the values in the matrix
                matrix[zahlen][counting_columns] -= item * bruch
            # manipulating the values in the vector
            vector[zahlen] -= vector[count] * bruch
            zahlen += 1
        count += 1

    __snake_case       :				List[str] 			=    0
    # make solutions
    __snake_case       :				list[str] 			=    []
    while count < x:
        solution.append(str(vector[count] / matrix[count][count]   )   )
        count += 1

    __snake_case       :				List[Any] 			=    0
    __snake_case       :				List[Any] 			=    """f(x)="""

    while count < x:
        __snake_case       :				list[str] 			=    solution[count].split("""E"""   )
        if len(__SCREAMING_SNAKE_CASE   ) > 1:
            __snake_case       :				str 			=    F'''{remove_e[0]}*10^{remove_e[1]}'''
        solved += F'''x^{x - (count + 1)}*{solution[count]}'''
        if count + 1 != x:
            solved += "+"
        count += 1

    return solved


if __name__ == "__main__":
     print(points_to_polynomial([]))
     print(points_to_polynomial([[]]))
     print(points_to_polynomial([[1, 0], [2, 0], [3, 0]]))
     print(points_to_polynomial([[1, 1], [2, 1], [3, 1]]))
     print(points_to_polynomial([[1, 3], [2, 3], [3, 3]]))
     print(points_to_polynomial([[1, 1], [2, 2], [3, 3]]))
     print(points_to_polynomial([[1, 1], [2, 4], [3, 9]]))
     print(points_to_polynomial([[1, 3], [2, 6], [3, 11]]))
     print(points_to_polynomial([[1, -3], [2, -6], [3, -11]]))
     print(points_to_polynomial([[1, 5], [2, 2], [3, 9]]))




import math
from timeit import timeit







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    __snake_case       :				Optional[Any] 			=    0
    __snake_case       :				Union[str, Any] 			=    abs(__SCREAMING_SNAKE_CASE   )
    while True:
        __snake_case       :				List[str] 			=    n // 1_0
        digits += 1
        if n == 0:
            break
    return digits







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    return 1 if n == 0 else math.floor(math.log(abs(__SCREAMING_SNAKE_CASE   )		,							1_0   ) + 1   )







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    return len(str(abs(__SCREAMING_SNAKE_CASE   )   )   )







def 					__lowerCAmelCase				(		):







    '''simple docstring'''
    from collections.abc import Callable

    def benchmark_a_function(__SCREAMING_SNAKE_CASE       :					Callable		,							__SCREAMING_SNAKE_CASE       :					int   ) -> None:
        __snake_case       :				Tuple 			=    F'''{func.__name__}({value})'''
        __snake_case       :				Union[str, Any] 			=    timeit(F'''__main__.{call}'''		,							setup="""import __main__"""   )
        print(F'''{call}: {func(__SCREAMING_SNAKE_CASE   )} -- {timing} seconds'''   )

    for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
        for func in (num_digits, num_digits_fast, num_digits_faster):
            benchmark_a_function(__SCREAMING_SNAKE_CASE		,							__SCREAMING_SNAKE_CASE   )
        print()


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     benchmark()



