




"""simple docstring"""




from collections.abc import Callable







def      __UpperCAmelCase     ( __UpperCamelCase	,				__UpperCamelCase	,				__UpperCamelCase	):
			__lowercase			:  float								=       a
			__lowercase			:  float								=       b
			if function(__UpperCamelCase	) == 0:  # one of the a or b is a root for the function
						return a
			elif function(__UpperCamelCase	) == 0:
						return b
			elif (
			    function(__UpperCamelCase	) * function(__UpperCamelCase	) > 0
			):  # if none of these are root and they are both positive or negative,
						# then this algorithm can't find the root
						raise ValueError('''could not find root in given interval.'''	)
			else:
						__lowercase			:  float								=       start + (end - start) / 2.0
						while abs(start - mid	) > 10**-7:  # until precisely equals to 10^-7
									if function(__UpperCamelCase	) == 0:
												return mid
									elif function(__UpperCamelCase	) * function(__UpperCamelCase	) < 0:
												__lowercase			:  str								=       mid
									else:
												__lowercase			:  Optional[Any]								=       mid
									__lowercase			:  List[str]								=       start + (end - start) / 2.0
						return mid







def      __UpperCAmelCase     ( __UpperCamelCase	):
			return x**3 - 2 * x - 5


if __name__ == "__main__":
			print(bisection(f, 1, 1_0_0_0))

			import doctest

			doctest.testmod()











def       _SCREAMING_SNAKE_CASE    (			__lowercase :      List[Any]     )    ->   Any:





    """simple docstring"""

    stooge(__lowercase      ,					0      ,					len(__lowercase     ) - 1     )
    return arr



def       _SCREAMING_SNAKE_CASE    (			__lowercase :      str      ,					__lowercase :      Dict      ,					__lowercase :      Dict     )    ->   int:





    """simple docstring"""

    if i >= h:
        return

    # If first element is smaller than the last then swap them
    if arr[i] > arr[h]:
        __A     ,						__A       =						arr[h], arr[i]

    # If there are more than 2 elements in the array
    if h - i + 1 > 2:
        __A       =						(int)((h - i + 1) / 3     )

        # Recursively sort first 2/3 elements
        stooge(__lowercase      ,					__lowercase      ,					(h - t)     )

        # Recursively sort last 2/3 elements
        stooge(__lowercase      ,					i + t      ,					(__lowercase)     )

        # Recursively sort first 2/3 elements
        stooge(__lowercase      ,					__lowercase      ,					(h - t)     )


if __name__ == "__main__":
  __a   :							List[Any]						= input("Enter numbers separated by a comma:\n").strip()
  __a   :							List[str]						= [int(item) for item in user_input.split(",")]
  print(stooge_sort(unsorted))




