
"""simple docstring"""







import unittest

import numpy as np
def   __lowercase   (					SCREAMING_SNAKE_CASE							,    SCREAMING_SNAKE_CASE							,    SCREAMING_SNAKE_CASE							,    SCREAMING_SNAKE_CASE = None							,    )  ->     np.ndarray:







							"""simple docstring"""


							__snake_case     			=       np.shape(__snake_case )
							__snake_case     			=       np.shape(__snake_case )
							__snake_case     			=       np.shape(__snake_case )

							if shape_a[0] != shape_b[0]:
														__snake_case     			=       (
														    "Expected the same number of rows for A and B. "
														    F'''Instead found A of size {shape_a} and B of size {shape_b}'''
														)
														raise ValueError(__snake_case )

							if shape_b[1] != shape_c[1]:
														__snake_case     			=       (
														    "Expected the same number of columns for B and C. "
														    F'''Instead found B of size {shape_b} and C of size {shape_c}'''
														)
														raise ValueError(__snake_case )

							__snake_case     			=       pseudo_inv
							if a_inv is None:
														try:
																					__snake_case     			=       np.linalg.inv(__snake_case )
														except np.linalg.LinAlgError:
																					raise ValueError(
																					    "Input matrix A is not invertible. Cannot compute Schur complement." )

							return mat_c - mat_b.T @ a_inv @ mat_b







class 							__magic_name__     (		unittest.TestCase   ):





					def 							lowerCAmelCase      (				self   :							Union[str, Any]    ):
												__snake_case     			=       np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]    )
												__snake_case     			=       np.array([[0, 3], [3, 0], [2, 3]]    )
												__snake_case     			=       np.array([[2, 1], [6, 3]]    )

												__snake_case     			=       schur_complement(snake_case_							,						snake_case_							,						snake_case_    )

												__snake_case     			=       np.block([[a, b], [b.T, c]]    )

												__snake_case     			=       np.linalg.det(snake_case_    )
												__snake_case     			=       np.linalg.det(snake_case_    )
												__snake_case     			=       np.linalg.det(snake_case_    )

												self.assertAlmostEqual(snake_case_							,						det_a * det_s    )





					def 							lowerCAmelCase      (				self   :							Tuple    ):
												__snake_case     			=       np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]    )
												__snake_case     			=       np.array([[0, 3], [3, 0], [2, 3]]    )
												__snake_case     			=       np.array([[2, 1], [6, 3]]    )

												with self.assertRaises(snake_case_    ):
																			schur_complement(snake_case_							,						snake_case_							,						snake_case_    )





					def 							lowerCAmelCase      (				self   :							int    ):
												__snake_case     			=       np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]    )
												__snake_case     			=       np.array([[0, 3], [3, 0], [2, 3]]    )
												__snake_case     			=       np.array([[2, 1, 3], [6, 3, 5]]    )

												with self.assertRaises(snake_case_    ):
																			schur_complement(snake_case_							,						snake_case_							,						snake_case_    )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		unittest.main()


"""simple docstring"""







def   __UpperCamelCase   (					SCREAMING_SNAKE_CASE )  ->     list:







							"""simple docstring"""


							__snake_case     			=       len(SCREAMING_SNAKE_CASE )
							for i in range(1							,    SCREAMING_SNAKE_CASE ):
														__snake_case     			=       collection[i]
														__snake_case     			=       0
														__snake_case     			=       i - 1

														while low <= high:
																					__snake_case     			=       (low + high) // 2
																					if val < collection[mid]:
																												__snake_case     			=       mid - 1
																					else:
																												__snake_case     			=       mid + 1
														for j in range(SCREAMING_SNAKE_CASE							,    SCREAMING_SNAKE_CASE							,    -1 ):
																					__snake_case     			=       collection[j - 1]
														__snake_case     			=       val
							return collection


if __name__ == "__main__":
		_SCREAMING_SNAKE_CASE	       =      input("""Enter numbers separated by a comma:\n""").strip()
		_SCREAMING_SNAKE_CASE	       =      [int(item) for item in user_input.split(""",""")]
		print(binary_insertion_sort(unsorted))
