



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





def 					__snake_case     (      _UpperCAmelCase    ):
    return binomial_coefficient(2 * node_count       ,			_UpperCAmelCase    ) // (node_count + 1)





def 					__snake_case     (      _UpperCAmelCase    ):
    if n < 0:
        raise ValueError('''factorial() not defined for negative values'''    )
    __a							=    1
    for i in range(1       ,			n + 1    ):
        result *= i
    return result





def 					__snake_case     (      _UpperCAmelCase    ):
    return catalan_number(_UpperCAmelCase    ) * factorial(_UpperCAmelCase    )


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










# Lint as: python3
import itertools
import os
import re


__snake_case						:int						=					re.compile(r'''([A-Z]+)([A-Z][a-z])''')
__snake_case						:List[Any]						=					re.compile(r'''([a-z\d])([A-Z])''')

__snake_case						:Dict						=					re.compile(r'''(?<!_)_(?!_)''')
__snake_case						:Optional[int]						=					re.compile(r'''(_{2,})''')

__snake_case						:Optional[Any]						=					r'''^\w+(\.\w+)*$'''

__snake_case						:Union[str, Any]						=					r'''<>:/\|?*'''





def 					__snake_case     (      _UpperCAmelCase    ):
    __a							=    _uppercase_uppercase_re.sub(R'''\1_\2'''       ,			_UpperCAmelCase    )
    __a							=    _lowercase_uppercase_re.sub(R'''\1_\2'''       ,			_UpperCAmelCase    )
    return name.lower()





def 					__snake_case     (      _UpperCAmelCase    ):
    __a							=    _single_underscore_re.split(_UpperCAmelCase    )
    __a							=    [_multiple_underscores_re.split(_UpperCAmelCase    ) for n in name]
    return "".join(n.capitalize() for n in itertools.chain.from_iterable(_UpperCAmelCase    ) if n != ''''''    )





def 					__snake_case     (      _UpperCAmelCase    ):
    if os.path.basename(_UpperCAmelCase    ) != name:
        raise ValueError(f'Should be a dataset name, not a path: {name}'    )
    return camelcase_to_snakecase(_UpperCAmelCase    )





def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase    ):
    if os.path.basename(_UpperCAmelCase    ) != name:
        raise ValueError(f'Should be a dataset name, not a path: {name}'    )
    if not re.match(_split_re       ,			_UpperCAmelCase    ):
        raise ValueError(f'Split name should match \'{_split_re}\'\' but got \'{split}\'.'    )
    return f'{filename_prefix_for_name(_UpperCAmelCase    )}-{split}'





def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase=None    ):
    __a							=    filename_prefix_for_split(_UpperCAmelCase       ,			_UpperCAmelCase    )
    if filetype_suffix:
        prefix += f'.{filetype_suffix}'
    __a							=    os.path.join(_UpperCAmelCase       ,			_UpperCAmelCase    )
    return f'{filepath}*'





def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase=None       ,			_UpperCAmelCase=None    ):
    __a							=    filename_prefix_for_split(_UpperCAmelCase       ,			_UpperCAmelCase    )
    __a							=    os.path.join(_UpperCAmelCase       ,			_UpperCAmelCase    )

    if shard_lengths:
        __a							=    len(_UpperCAmelCase    )
        __a							=    [f'{prefix}-{shard_id:05d}-of-{num_shards:05d}' for shard_id in range(_UpperCAmelCase    )]
        if filetype_suffix:
            __a							=    [filename + f'.{filetype_suffix}' for filename in filenames]
        return filenames
    else:
        __a							=    prefix
        if filetype_suffix:
            filename += f'.{filetype_suffix}'
        return [filename]





