





"""simple docstring"""



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



    '''simple docstring'''







    _enforce_args(__a    ,__a						)
    if n == 0:
        return 0
    __A   :						Optional[Any]									=					float('''-inf'''						)
    for i in range(1    ,n + 1						):
        __A   :						List[Any]									=					max(
            __a    ,prices[i - 1] + naive_cut_rod_recursive(n - i    ,__a						)						)

    return max_revue







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



    '''simple docstring'''







    _enforce_args(__a    ,__a						)
    __A   :						Optional[Any]									=					[float('''-inf'''						) for _ in range(n + 1						)]
    return _top_down_cut_rod_recursive(__a    ,__a    ,__a						)







def 		__lowercase					(       snake_case_  :  int    ,snake_case_  :  list    ,snake_case_  :  list						)       ->Union[str, Any]:



    '''simple docstring'''







    if max_rev[n] >= 0:
        return max_rev[n]
    elif n == 0:
        return 0
    else:
        __A   :						Optional[int]									=					float('''-inf'''						)
        for i in range(1    ,n + 1						):
            __A   :						Union[str, Any]									=					max(
                __a    ,prices[i - 1] + _top_down_cut_rod_recursive(n - i    ,__a    ,__a						)    ,)

        __A   :						Dict									=					max_revenue

    return max_rev[n]







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



    '''simple docstring'''







    _enforce_args(__a    ,__a						)

    # length(max_rev) = n + 1, to accommodate for the revenue obtainable from a rod of
    # length 0.
    __A   :						Any									=					[float('''-inf'''						) for _ in range(n + 1						)]
    __A   :						str									=					0

    for i in range(1    ,n + 1						):
        __A   :						List[Any]									=					max_rev[i]
        for j in range(1    ,i + 1						):
            __A   :						Tuple									=					max(__a    ,prices[j - 1] + max_rev[i - j]						)

        __A   :						Optional[int]									=					max_revenue_i

    return max_rev[n]







def 		__lowercase					(       snake_case_  :  int    ,snake_case_  :  list						)       ->Optional[Any]:



    '''simple docstring'''







    if n < 0:
        __A   :						Union[str, Any]									=					F"""n must be greater than or equal to 0. Got n = {n}"""
        raise ValueError(__a						)

    if n > len(__a						):
        __A   :						Optional[Any]									=					(
            '''Each integral piece of rod must have a corresponding price. '''
            F"""Got n = {n} but length of prices = {len(__a						)}"""
        )
        raise ValueError(__a						)







def 		__lowercase					(       )       ->Dict:



    '''simple docstring'''







    __A   :						Dict									=					[6, 10, 12, 15, 20, 23]
    __A   :						Tuple									=					len(__a						)

    # the best revenue comes from cutting the rod into 6 pieces, each
    # of length 1 resulting in a revenue of 6 * 6 = 36.
    __A   :						str									=					36

    __A   :						List[Any]									=					top_down_cut_rod(__a    ,__a						)
    __A   :						Union[str, Any]									=					bottom_up_cut_rod(__a    ,__a						)
    __A   :						Dict									=					naive_cut_rod_recursive(__a    ,__a						)

    assert expected_max_revenue == max_rev_top_down
    assert max_rev_top_down == max_rev_bottom_up
    assert max_rev_bottom_up == max_rev_naive


if __name__ == "__main__":
       main()










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




