





'''simple docstring'''




import re
from pathlib import Path
from unittest import TestCase

import pytest




@pytest.mark.integration
class      UpperCamelCase__					(					lowercase_			):




					"""simple docstring"""


					def lowerCamelCase_			(						self				:			Union[str, Any]      ,						lowerCamelCase_				:			str						):

							'''simple docstring'''



							with open(lowerCamelCase_      ,						encoding="""utf-8"""						) as input_file:
									SCREAMING_SNAKE_CASE :				Dict		=			re.compile(R"""(?!.*\b(?:encoding|rb|w|wb|w+|wb+|ab|ab+)\b)(?<=\s)(open)\((.*)\)"""						)
									SCREAMING_SNAKE_CASE :				List[Any]		=			input_file.read()
									SCREAMING_SNAKE_CASE :				Optional[int]		=			regexp.search(lowerCamelCase_						)

							return match


					def lowerCamelCase_			(						self				:			str      ,						lowerCamelCase_				:			str						):

							'''simple docstring'''



							with open(lowerCamelCase_      ,						encoding="""utf-8"""						) as input_file:
									SCREAMING_SNAKE_CASE :				str		=			re.compile(R"""#[^\r\n]*print\(|\"[^\r\n]*print\(|\"\"\".*?print\(.*?\"\"\"|(print\()"""      ,						re.DOTALL						)
									SCREAMING_SNAKE_CASE :				Any		=			input_file.read()
									# use `re.finditer` to handle the case where the ignored groups would be matched first by `re.search`
									SCREAMING_SNAKE_CASE :				Optional[int]		=			regexp.finditer(lowerCamelCase_						)

							SCREAMING_SNAKE_CASE :				Tuple		=			[match for match in matches if match is not None and match.group(1						) is not None]
							return matches[0] if matches else None


					def lowerCamelCase_			(						self				:			List[Any]						):

							'''simple docstring'''



							SCREAMING_SNAKE_CASE :				List[Any]		=			Path("""./datasets"""						)
							SCREAMING_SNAKE_CASE :				Dict		=			list(dataset_paths.absolute().glob("""**/*.py"""						)						)

							for dataset in dataset_files:
									if self._no_encoding_on_file_open(str(lowerCamelCase_						)						):
											raise AssertionError(f'''open(...) must use utf-8 encoding in {dataset}'''						)



					def lowerCamelCase_			(						self				:			List[str]						):

							'''simple docstring'''



							SCREAMING_SNAKE_CASE :				Optional[Any]		=			Path("""./datasets"""						)
							SCREAMING_SNAKE_CASE :				Union[str, Any]		=			list(dataset_paths.absolute().glob("""**/*.py"""						)						)

							for dataset in dataset_files:
									if self._no_print_statements(str(lowerCamelCase_						)						):
											raise AssertionError(f'''print statement found in {dataset}. Use datasets.logger/logging instead.'''						)










'''simple docstring'''




def 		__A		(  lowerCamelCase_			,			lowerCamelCase_	):


		"""simple docstring"""



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



def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



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



def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



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



def 		__A		(  lowerCamelCase_	):


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



