from __future__ import annotations

lowerCAmelCase      :				Optional[Any]     			="Alexander Joslin"







def     A__	(       __A						):







    '''simple docstring'''

    if number <= 0:
        _lowerCamelCase  :		str			    =    F"""n must be greater than 0. Got n = {number}"""
        raise ValueError(__A						)

    _lowerCamelCase  :		Union[str, Any]			    =    [number + 1] * (number + 1)

    # starting position
    _lowerCamelCase  :		List[str]			    =    0
    for i in range(1 ,			__A						):
        _lowerCamelCase  :		Dict			    =    min(table[i + 1] ,			table[i] + 1						)
        # check if out of bounds
        if i * 2 <= number:
            _lowerCamelCase  :		List[str]			    =    min(table[i * 2] ,			table[i] + 1						)
        # check if out of bounds
        if i * 3 <= number:
            _lowerCamelCase  :		int			    =    min(table[i * 3] ,			table[i] + 1						)
    return table[number]


if __name__ == "__main__":
    import doctest

    doctest.testmod()





lowerCAmelCase      :				Union[str, Any]     			=1000







def     A__	(       __A						):







    '''simple docstring'''
    return x * x







def     A__	(       __A ,			__A ,			__A ,			__A = 4						):







    '''simple docstring'''
    assert callable(
        __A						), F"""the function(object) passed should be callable your input : {function}"""
    assert isinstance(__A ,			(float, int)						), F"""a should be float or integer your input : {a}"""
    assert isinstance(function(__A						) ,			(float, int)						), (
        "the function should return integer or float return type of your function, "
        F"""{type(__A						)}"""
    )
    assert isinstance(__A ,			(float, int)						), F"""b should be float or integer your input : {b}"""
    assert (
        isinstance(__A ,			__A						) and precision > 0
    ), F"""precision should be positive integer your input : {precision}"""

    # just applying the formula of simpson for approximate integration written in
    # mentioned article in first comment of this file and above this function

    _lowerCamelCase  :		Optional[Any]			    =    (b - a) / N_STEPS
    _lowerCamelCase  :		str			    =    function(__A						) + function(__A						)

    for i in range(1 ,			__A						):
        _lowerCamelCase  :		str			    =    a + h * i
        result += function(__A						) * (4 if i % 2 else 2)

    result *= h / 3
    return round(__A ,			__A						)


if __name__ == "__main__":
    import doctest

    doctest.testmod()




