





"""simple docstring"""



from __future__ import annotations







def 		__lowercase					(       snake_case_  :  Any    ,snake_case_  :  List[str]						)       ->Any:



    '''simple docstring'''







    if b == 0:
        return (1, 0)
    (__A)   :						Optional[int]									=					extended_euclid(_UpperCAmelCase    ,a % b						)
    __A   :						int									=					a // b
    return (y, x - k * y)







def 		__lowercase					(       snake_case_  :  Optional[Any]    ,snake_case_  :  Union[str, Any]    ,snake_case_  :  Optional[Any]    ,snake_case_  :  str						)       ->Tuple:



    '''simple docstring'''







    (__A)   :						List[Any]									=					extended_euclid(_UpperCAmelCase    ,_UpperCAmelCase						)
    __A   :						List[str]									=					na * na
    __A   :						List[str]									=					ra * x * na + ra * y * na
    return (n % m + m) % m







def 		__lowercase					(       snake_case_  :  List[str]    ,snake_case_  :  Optional[int]						)       ->List[str]:



    '''simple docstring'''







    (__A)   :						Union[str, Any]									=					extended_euclid(_UpperCAmelCase    ,_UpperCAmelCase						)
    if b < 0:
        __A   :						List[Any]									=					(b % n + n) % n
    return b







def 		__lowercase					(       snake_case_  :  str    ,snake_case_  :  Tuple    ,snake_case_  :  Any    ,snake_case_  :  Dict						)       ->List[Any]:



    '''simple docstring'''







    __A   :						str									=					invert_modulo(_UpperCAmelCase    ,_UpperCAmelCase						), invert_modulo(_UpperCAmelCase    ,_UpperCAmelCase						)
    __A   :						Tuple									=					na * na
    __A   :						int									=					ra * x * na + ra * y * na
    return (n % m + m) % m


if __name__ == "__main__":
       from doctest import testmod

       testmod(name="""chinese_remainder_theorem""", verbose=True)
       testmod(name="""chinese_remainder_theorem2""", verbose=True)
       testmod(name="""invert_modulo""", verbose=True)
       testmod(name="""extended_euclid""", verbose=True)










"""simple docstring"""



from math import factorial







def 		__lowercase					(       snake_case_  :  int    ,snake_case_  :  int						)       ->int:



    '''simple docstring'''







    if n < k or k < 0:
        raise ValueError('''Please enter positive integers for n and k where n >= k'''						)
    return factorial(snake_case_						) // (factorial(snake_case_						) * factorial(n - k						))


if __name__ == "__main__":
       print(
           """The number of five-card hands possible from a standard""",
           f'''fifty-two card deck is: {combinations(52, 5)}\n''',
       )

       print(
           """If a class of 40 students must be arranged into groups of""",
           f'''4 for group projects, there are {combinations(40, 4)} ways''',
           """to arrange them.\n""",
       )

       print(
           """If 10 teams are competing in a Formula One race, there""",
           f'''are {combinations(10, 3)} ways that first, second and''',
           """third place can be awarded.""",
       )




