





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






def 	_SCREAMING_SNAKE_CASE		(      SCREAMING_SNAKE_CASE		:int   )      ->   int:
 return binomial_coefficient(2 * node_count   ,   SCREAMING_SNAKE_CASE   ) // (node_count + 1)






def 	_SCREAMING_SNAKE_CASE		(      SCREAMING_SNAKE_CASE		:int   )      ->   int:
 if n < 0:
  raise ValueError("""factorial() not defined for negative values"""   )
 __lowerCAmelCase					:	Optional[int]      =       1
 for i in range(1   ,   n + 1   ):
  result *= i
 return result






def 	_SCREAMING_SNAKE_CASE		(      SCREAMING_SNAKE_CASE		:int   )      ->   int:
 return catalan_number(SCREAMING_SNAKE_CASE   ) * factorial(SCREAMING_SNAKE_CASE   )


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.'''
 )






def 	_SCREAMING_SNAKE_CASE		(      SCREAMING_SNAKE_CASE		:list[list[int | float]]   )      ->   int:
 __lowerCAmelCase					:	str      =       len(SCREAMING_SNAKE_CASE   )
 __lowerCAmelCase					:	Optional[int]      =       len(matrix[0]   )
 __lowerCAmelCase					:	List[Any]      =       min(SCREAMING_SNAKE_CASE   ,   SCREAMING_SNAKE_CASE   )

 for row in range(SCREAMING_SNAKE_CASE   ):
  # Check if diagonal element is not zero
  if matrix[row][row] != 0:
   # Eliminate all the elements below the diagonal
   for col in range(row + 1   ,   SCREAMING_SNAKE_CASE   ):
    __lowerCAmelCase					:	Union[str, Any]      =       matrix[col][row] / matrix[row][row]
    for i in range(SCREAMING_SNAKE_CASE   ,   SCREAMING_SNAKE_CASE   ):
     matrix[col][i] -= multiplier * matrix[row][i]
  else:
   # Find a non-zero diagonal element to swap rows
   __lowerCAmelCase					:	Optional[int]      =       True
   for i in range(row + 1   ,   SCREAMING_SNAKE_CASE   ):
    if matrix[i][row] != 0:
     __lowerCAmelCase ,					__lowerCAmelCase					:	Union[str, Any]      =       matrix[i], matrix[row]
     __lowerCAmelCase					:	Union[str, Any]      =       False
     break
   if reduce:
    rank -= 1
    for i in range(SCREAMING_SNAKE_CASE   ):
     __lowerCAmelCase					:	int      =       matrix[i][rank]

            # Reduce the row pointer by one to stay on the same row
   row -= 1

 return rank


if __name__ == "__main__":
      import doctest

      doctest.testmod()