






"""simple docstring"""





def     A(  snake_case_		):
							"""simple docstring"""





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

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

							lowercase__:    Tuple        =      {x for x, _ in coordinates}
							if len(_lowerCAmelCase		) == 1:
														return F"""x={coordinates[0][0]}"""

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

							lowercase__:    List[str]        =      len(_lowerCAmelCase		)

							lowercase__:    str        =      0
							lowercase__:    Optional[int]        =      []
							# put the x and x to the power values in a matrix
							while count_of_line < x:
														lowercase__:    str        =      0
														lowercase__:    Tuple        =      coordinates[count_of_line][0]
														lowercase__:    Optional[int]        =      []
														while count_in_line < x:
																					count_line.append(a ** (x - (count_in_line + 1))		)
																					count_in_line += 1
														matrix.append(_lowerCAmelCase		)
														count_of_line += 1

							lowercase__:    Optional[Any]        =      0
							# put the y values into a vector
							lowercase__:    str        =      []
							while count_of_line < x:
														vector.append(coordinates[count_of_line][1]		)
														count_of_line += 1

							lowercase__:    Optional[int]        =      0

							while count < x:
														lowercase__:    Dict        =      0
														while zahlen < x:
																					if count == zahlen:
																												zahlen += 1
																					if zahlen == x:
																												break
																					lowercase__:    str        =      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

							lowercase__:    Optional[Any]        =      0
							# make solutions
							lowercase__:    Any        =      []
							while count < x:
														solution.append(str(vector[count] / matrix[count][count]		)		)
														count += 1

							lowercase__:    Dict        =      0
							lowercase__:    Optional[int]        =      "f(x)="

							while count < x:
														lowercase__:    int        =      solution[count].split("E"		)
														if len(_lowerCAmelCase		) > 1:
																					lowercase__:    int        =      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]]))














"""simple docstring"""





UpperCamelCase			=      {
    """0""": 1,
    """1""": 1,
    """2""": 2,
    """3""": 6,
    """4""": 24,
    """5""": 1_20,
    """6""": 7_20,
    """7""": 50_40,
    """8""": 4_03_20,
    """9""": 36_28_80,
}

UpperCamelCase			=      {1_45: 1_45}

UpperCamelCase			=      {
    1_45: 0,
    1_69: 3,
    3_63_01: 3,
    14_54: 3,
    8_71: 2,
    4_53_61: 2,
    8_72: 2,
}






def     A(  snake_case_		):
       """simple docstring"""





       if n in CACHE_SUM_DIGIT_FACTORIALS:
              return CACHE_SUM_DIGIT_FACTORIALS[n]
       lowercase__:    Any        =      sum(DIGIT_FACTORIALS[let] for let in str(snake_case_		)		)
       lowercase__:    Optional[Any]        =      ret
       return ret






def     A(  snake_case_						,       snake_case_ = None		):
       """simple docstring"""





       lowercase__:    Optional[int]        =      previous or set()
       if n in CHAIN_LENGTH_CACHE:
              return CHAIN_LENGTH_CACHE[n]
       lowercase__:    Tuple        =      sum_digit_factorials(snake_case_		)
       if next_number in previous:
              lowercase__:    List[Any]        =      0
              return 0
       else:
              previous.add(snake_case_		)
              lowercase__:    Optional[int]        =      1 + chain_length(snake_case_						,       snake_case_		)
              lowercase__:    Any        =      ret
              return ret






def     A(  snake_case_ = 60						,       snake_case_ = 1000000		):
       """simple docstring"""





       return sum(1 for i in range(1						,       snake_case_		) if chain_length(snake_case_		) == num_terms		)


if __name__ == "__main__":
  print(F"{solution() = }")






