






def 					lowercase_ (    __snake_case     :							int	,	__snake_case     :							int      )     -> Dict:





				'''simple docstring'''


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


def 					lowercase_ (    __snake_case     :							int      )     -> List[str]:





				'''simple docstring'''


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


def 					lowercase_ (    __snake_case     :							int      )     -> List[Any]:





				'''simple docstring'''


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


def 					lowercase_ (    __snake_case     :							int      )     -> Dict:





				'''simple docstring'''


				return catalan_number(__UpperCamelCase      ) * factorial(__UpperCamelCase      )


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







from __future__ import annotations

import math





def 					lowercase_ (    __snake_case     :							int	,	__snake_case     :							int	,	__snake_case     :							bool	,	__snake_case     :							list[int]	,	__snake_case     :							float      )     -> int:





				'''simple docstring'''


				if depth < 0:
								raise ValueError("Depth cannot be less than 0"      )

				if len(__snake_case      ) == 0:
								raise ValueError("Scores cannot be empty"      )

				if depth == height:
								return scores[node_index]

				if is_max:
								return max(
								    minimax(depth + 1	,	node_index * 2	,	__snake_case	,	__snake_case	,	__snake_case      )	,	minimax(depth + 1	,	node_index * 2 + 1	,	__snake_case	,	__snake_case	,	__snake_case      )	,	)

				return min(
				    minimax(depth + 1	,	node_index * 2	,	__snake_case	,	__snake_case	,	__snake_case      )	,	minimax(depth + 1	,	node_index * 2 + 1	,	__snake_case	,	__snake_case	,	__snake_case      )	,	)





def 					lowercase_ (    )     -> None:





				'''simple docstring'''


				snake_case__      :List[Any]         =   [90, 23, 6, 33, 21, 65, 1_23, 3_44_23]
				snake_case__      :int         =   math.log(len(__snake_case      )	,	2      )
				print("Optimal value : "	,	end=""      )
				print(minimax(0	,	0	,	__snake_case	,	__snake_case	,	__snake_case      )      )


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()