





'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase : int     ,__lowerCamelCase : int			):
   lowercase_      :List[Any]         =			1  # To kept the Calculated Value
   # Since C(n, k) = C(n, n-k)
   if k > (n - k):
      lowercase_      :Optional[Any]         =			n - k
   # Calculate C(n,k)
   for i in range(__lowerCamelCase			):
      result *= n - i
      result //= i + 1
   return result
def 							UpperCAmelCase_  (						__lowerCamelCase : int			):
   return binomial_coefficient(2 * node_count     ,__lowerCamelCase			) // (node_count + 1)
def 							UpperCAmelCase_  (						__lowerCamelCase : int			):
   if n < 0:
      raise ValueError("factorial() not defined for negative values"			)
   lowercase_      :str         =			1
   for i in range(1     ,n + 1			):
      result *= i
   return result
def 							UpperCAmelCase_  (						__lowerCamelCase : int			):
   return catalan_number(__lowerCamelCase			) * factorial(__lowerCamelCase			)


if __name__ == "__main__":
 lowerCAmelCase :					Optional[int] 							=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.'''
 )









'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase : dict			):
   lowercase_      :set[int]         =			set()
   # To detect a back edge, keep track of vertices currently in the recursion stack
   lowercase_      :set[int]         =			set()
   return any(
       node not in visited and depth_first_search(__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase			)
       for node in graph			)
def 							UpperCAmelCase_  (						__lowerCamelCase : dict     ,__lowerCamelCase : int     ,__lowerCamelCase : set     ,__lowerCamelCase : set			):
   visited.add(__lowerCamelCase			)
   rec_stk.add(__lowerCamelCase			)

   for node in graph[vertex]:
      if node not in visited:
         if depth_first_search(__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase			):
            return True
      elif node in rec_stk:
         return True

    # The node needs to be removed from recursion stack before function ends
   rec_stk.remove(__lowerCamelCase			)
   return False


if __name__ == "__main__":
 from doctest import testmod

 testmod()


