






"""simple docstring"""







def _a					(						_snake_case ,			_snake_case				):







      """simple docstring"""






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

def _a					(						_snake_case				):







      """simple docstring"""






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

def _a					(						_snake_case				):







      """simple docstring"""






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

def _a					(						_snake_case				):







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




"""simple docstring"""


import random





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase  ,       __lowerCAmelCase = False							)				->   dict:




						'''simple docstring'''



						lowerCamelCase__   ={i: [] for i in range(__lowerCAmelCase							)}

						# if probability is greater or equal than 1, then generate a complete graph
						if probability >= 1:
												return complete_graph(__lowerCAmelCase							)
						# if probability is lower or equal than 0, then return a graph without edges
						if probability <= 0:
												return graph

						# for each couple of nodes, add an edge from u to v
						# if the number randomly generated is greater than probability probability
						for i in range(__lowerCAmelCase							):
												for j in range(i + 1  ,       __lowerCAmelCase							):
																		if random.random() < probability:
																								graph[i].append(__lowerCAmelCase							)
																								if not directed:
																														# if the graph is undirected, add an edge in from j to i, either
																														graph[j].append(__lowerCAmelCase							)
						return graph





def      lowerCamelCase_					(   __lowerCAmelCase							)				->   dict:




						'''simple docstring'''



						return {
						    i: [j for j in range(__lowerCAmelCase							) if i != j] for i in range(__lowerCAmelCase							)
						}


if __name__ == "__main__":
	import doctest

	doctest.testmod()


