

"""simple docstring"""




import math

def 						A							(  snake_case__     ):




			'''simple docstring'''


			SCREAMING_SNAKE_CASE__										=   []
			SCREAMING_SNAKE_CASE__										=   2
			SCREAMING_SNAKE_CASE__										=   int(math.sqrt(snake_case__     )     )  # Size of every segment
			SCREAMING_SNAKE_CASE__										=   [True] * (end + 1)
			SCREAMING_SNAKE_CASE__										=   []

			while start <= end:
						if temp[start] is True:
									in_prime.append(snake_case__     )
									for i in range(start * start		,					end + 1		,					snake_case__     ):
												SCREAMING_SNAKE_CASE__										=   False
						start += 1
			prime += in_prime

			SCREAMING_SNAKE_CASE__										=   end + 1
			SCREAMING_SNAKE_CASE__										=   min(2 * end		,					snake_case__     )

			while low <= n:
						SCREAMING_SNAKE_CASE__										=   [True] * (high - low + 1)
						for each in in_prime:
									SCREAMING_SNAKE_CASE__										=   math.floor(low / each     ) * each
									if t < low:
												t += each

									for j in range(snake_case__		,					high + 1		,					snake_case__     ):
												SCREAMING_SNAKE_CASE__										=   False

						for j in range(len(snake_case__     )     ):
									if temp[j] is True:
												prime.append(j + low     )

						SCREAMING_SNAKE_CASE__										=   high + 1
						SCREAMING_SNAKE_CASE__										=   min(high + end		,					snake_case__     )

			return prime




print(sieve(10**6))





"""simple docstring"""




def 						A							(  snake_case__		,					snake_case__     ):




			'''simple docstring'''


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

def 						A							(  snake_case__     ):




			'''simple docstring'''


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

def 						A							(  snake_case__     ):




			'''simple docstring'''


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

def 						A							(  snake_case__     ):




			'''simple docstring'''


			return catalan_number(snake_case__     ) * factorial(snake_case__     )


if __name__ == "__main__":
						A_				:      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.'
						)


