



def        A       (      _lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							_lowerCAmelCase  :							Dict				     =					1  # To kept the Calculated Value
							# Since C(n, k) = C(n, n-k)
							if k > (n - k):
														_lowerCAmelCase  :							str				     =					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"						)
							_lowerCAmelCase  :							Any				     =					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__":
						_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.'''
						)





def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							def count_of_possible_combinations(_lowerCamelCase						) -> int:
														if target < 0:
																					return 0
														if target == 0:
																					return 1
														return sum(count_of_possible_combinations(target - item						) for item in array						)

							return count_of_possible_combinations(_lowerCamelCase						)






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							def count_of_possible_combinations_with_dp_array(
							    _lowerCamelCase       ,				_lowerCamelCase						) -> int:
														if target < 0:
																					return 0
														if target == 0:
																					return 1
														if dp_array[target] != -1:
																					return dp_array[target]
														_lowerCAmelCase  :							Optional[int]				     =					sum(
														    count_of_possible_combinations_with_dp_array(target - item       ,				_lowerCamelCase						)
														    for item in array						)
														_lowerCAmelCase  :							Any				     =					answer
														return answer

							_lowerCAmelCase  :							List[Any]				     =					[-1] * (target + 1)
							return count_of_possible_combinations_with_dp_array(_lowerCamelCase       ,				_lowerCamelCase						)






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							_lowerCAmelCase  :							List[Any]				     =					[0] * (target + 1)
							_lowerCAmelCase  :							List[str]				     =					1

							for i in range(1       ,				target + 1						):
														for j in range(_lowerCamelCase						):
																					if i - array[j] >= 0:
																												dp_array[i] += dp_array[i - array[j]]

							return dp_array[target]


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						_snake_case	=						3
						_snake_case	=						5
						_snake_case	=						[1, 2, 5]
						print(combination_sum_iv(n, array, target))
