


'''simple docstring'''
def       a				(      __a			, __a       )  ->     int:



					'''simple docstring'''






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


def       a				(      __a       )  ->     int:



					'''simple docstring'''






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


def       a				(      __a       )  ->     int:



					'''simple docstring'''






					if n < 0:
										raise ValueError('''factorial() not defined for negative values'''       )
					UpperCamelCase__       :Union[str, Any]							 =			1
					for i in range(1			, n + 1       ):
										result *= i
					return result


def       a				(      __a       )  ->     int:



					'''simple docstring'''






					return catalan_number(__a       ) * factorial(__a       )


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'''
from __future__ import annotations

from typing import Any


def       a				(      __a       )  ->     None:



					'''simple docstring'''






					create_state_space_tree(__a			, []			, 0       )


def       a				(      __a			, __a			, __a       )  ->     None:



					'''simple docstring'''






					if index == len(__a       ):
										print(__a       )
										return

					create_state_space_tree(__a			, __a			, index + 1       )
					current_subsequence.append(sequence[index]       )
					create_state_space_tree(__a			, __a			, index + 1       )
					current_subsequence.pop()


if __name__ == "__main__":
		__snake_case											=					[3, 1, 2, 4]
		generate_all_subsequences(seq)

		seq.clear()
		seq.extend(['''A''', '''B''', '''C'''])
		generate_all_subsequences(seq)