


"""simple docstring"""



def   __lowerCAmelCase						(						lowercase  :  int						,							lowercase  :  int )	->						int:


    """simple docstring"""





    snake_case    :      List[str]      					=    1  # To kept the Calculated Value
    # Since C(n, k) = C(n, n-k)
    if k > (n - k):
        snake_case    :      List[str]      					=    n - k
    # Calculate C(n,k)
    for i in range(lowercase ):
        result *= n - i
        result //= i + 1
    return result







def   __lowerCAmelCase						(						lowercase  :  int )	->						int:


    """simple docstring"""





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







def   __lowerCAmelCase						(						lowercase  :  int )	->						int:


    """simple docstring"""





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







def   __lowerCAmelCase						(						lowercase  :  int )	->						int:


    """simple docstring"""





    return catalan_number(lowercase ) * factorial(lowercase )


if __name__ == "__main__":
  __snake_case   			=    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   __lowerCAmelCase						(						lowercase  :  list )	->						int:


    """simple docstring"""





    if not grid or not grid[0]:
        raise TypeError("The grid does not contain the appropriate information" )

    for cell_n in range(1						,							len(grid[0] ) ):
        grid[0][cell_n] += grid[0][cell_n - 1]
    snake_case    :      int      					=    grid[0]

    for row_n in range(1						,							len(lowercase ) ):
        snake_case    :      Optional[Any]      					=    grid[row_n]
        snake_case    :      List[str]      					=    fill_row(lowercase						,							lowercase )
        snake_case    :      Optional[int]      					=    grid[row_n]

    return grid[-1][-1]







def   __lowerCAmelCase						(						lowercase  :  list						,							lowercase  :  list )	->						list:


    """simple docstring"""





    current_row[0] += row_above[0]
    for cell_n in range(1						,							len(lowercase ) ):
        current_row[cell_n] += min(current_row[cell_n - 1]						,							row_above[cell_n] )

    return current_row


if __name__ == "__main__":
  import doctest

  doctest.testmod()





