'''simple docstring'''






import unittest

import numpy as np





def  _SCREAMING_SNAKE_CASE		(      __snake_case							:			List[str]   ,		__snake_case							:			str   ,		__snake_case							:			List[str]   ,		__snake_case							:			List[Any] = None   ,		):
     _A    		=  np.shape(lowerCamelCase_				)
     _A    		=  np.shape(lowerCamelCase_				)
     _A    		=  np.shape(lowerCamelCase_				)

     if shape_a[0] != shape_b[0]:
          _A    		=  (
              """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(lowerCamelCase_				)

     if shape_b[1] != shape_c[1]:
          _A    		=  (
              """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(lowerCamelCase_				)

     _A    		=  pseudo_inv
     if a_inv is None:
          try:
               _A    		=  np.linalg.inv(lowerCamelCase_				)
          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 lowercase_       (		unittest.TestCase			):







   """simple docstring"""

   def 	__UpperCAmelCase   (      self      :			Union[str, Any]     )  ->			str:
        _A    		=  np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]     )
        _A    		=  np.array([[0, 3], [3, 0], [2, 3]]     )
        _A    		=  np.array([[2, 1], [6, 3]]     )

        _A    		=  schur_complement(lowerCamelCase_, lowerCamelCase_, lowerCamelCase_     )

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

        _A    		=  np.linalg.det(lowerCamelCase_     )
        _A    		=  np.linalg.det(lowerCamelCase_     )
        _A    		=  np.linalg.det(lowerCamelCase_     )

        self.assertAlmostEqual(lowerCamelCase_, det_a * det_s     )
   def 	__UpperCAmelCase   (      self      :			Optional[Any]     )  ->			Union[str, Any]:
        _A    		=  np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]     )
        _A    		=  np.array([[0, 3], [3, 0], [2, 3]]     )
        _A    		=  np.array([[2, 1], [6, 3]]     )

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

   def 	__UpperCAmelCase   (      self      :			int     )  ->			Union[str, Any]:
        _A    		=  np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]     )
        _A    		=  np.array([[0, 3], [3, 0], [2, 3]]     )
        _A    		=  np.array([[2, 1, 3], [6, 3, 5]]     )

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


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   unittest.main()










'''simple docstring'''




def 		__A		(  lowerCamelCase_			,			lowerCamelCase_	):


		"""simple docstring"""



		SCREAMING_SNAKE_CASE :				str		=			1  # To kept the Calculated Value
		# Since C(n, k) = C(n, n-k)
		if k > (n - k):
				SCREAMING_SNAKE_CASE :				Dict		=			n - k
		# Calculate C(n,k)
		for i in range(lowerCamelCase_	):
				result *= n - i
				result //= i + 1
		return result



def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



		return binomial_coefficient(2 * node_count			,			lowerCamelCase_	) // (node_count + 1)



def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



		if n < 0:
				raise ValueError("""factorial() not defined for negative values"""	)
		SCREAMING_SNAKE_CASE :				Dict		=			1
		for i in range(1			,			n + 1	):
				result *= i
		return result



def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



		return catalan_number(lowerCamelCase_	) * factorial(lowerCamelCase_	)


if __name__ == "__main__":
							__UpperCAmelCase            =       int(input("""Enter the number of nodes: """).strip() or 0)
							if node_count <= 0:
														raise ValueError("""We need some nodes to work with.""")
							print(
							    f'''Given {node_count} nodes, there are {binary_tree_count(node_count)} '''
							    f'''binary trees and {catalan_number(node_count)} binary search trees.'''
							)



