


"""simple docstring"""



from __future__ import annotations

from itertools import permutations
from random import randint
from timeit import repeat







def 						__lowerCAmelCase		(		)			->		tuple[list[int], int]:


    """simple docstring"""





    snake_case					:   Optional[int]         =					[randint(-1000		,							1000				) for i in range(10				)]
    snake_case					:   Optional[int]         =					randint(-5000		,							5000				)
    return (arr, r)


__snake_case         =					make_dataset()







def 						__lowerCAmelCase		(		lowercase						:						list[int]		,							lowercase						:						int				)			->		tuple[int, ...]:


    """simple docstring"""





    for triplet in permutations(lowercase		,							3				):
        if sum(lowercase				) == target:
            return tuple(sorted(lowercase				)				)
    return (0, 0, 0)







def 						__lowerCAmelCase		(		lowercase						:						list[int]		,							lowercase						:						int				)			->		tuple[int, int, int]:


    """simple docstring"""





    arr.sort()
    snake_case					:   Tuple         =					len(lowercase				)
    for i in range(n - 1				):
        snake_case      ,snake_case					:   Union[str, Any]         =					i + 1, n - 1
        while left < right:
            if arr[i] + arr[left] + arr[right] == target:
                return (arr[i], arr[left], arr[right])
            elif arr[i] + arr[left] + arr[right] < target:
                left += 1
            elif arr[i] + arr[left] + arr[right] > target:
                right -= 1
    return (0, 0, 0)







def 						__lowerCAmelCase		(		)			->		tuple[float, float]:


    """simple docstring"""





    snake_case					:   Union[str, Any]         =					"\nfrom __main__ import dataset, triplet_sum1, triplet_sum2\n"
    snake_case					:   List[str]         =					"\ntriplet_sum1(*dataset)\n"
    snake_case					:   List[str]         =					"\ntriplet_sum2(*dataset)\n"
    snake_case					:   List[Any]         =					repeat(setup=lowercase		,							stmt=lowercase		,							repeat=5		,							number=1_0000				)
    snake_case					:   Optional[Any]         =					repeat(setup=lowercase		,							stmt=lowercase		,							repeat=5		,							number=1_0000				)
    return (min(lowercase				), min(lowercase				))


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

  testmod()
  __snake_case         =					solution_times()
  print(F'''The time for naive implementation is {times[0]}.''')
  print(F'''The time for optimized implementation is {times[1]}.''')









"""simple docstring"""



from __future__ import annotations

from cmath import sqrt







def 						__lowerCAmelCase		(		lowercase						:						int		,							lowercase						:						int		,							lowercase						:						int				)			->		tuple[complex, complex]:


    """simple docstring"""





    if a == 0:
        raise ValueError("Coefficient 'a' must not be zero."				)
    snake_case					:   Dict         =					b * b - 4 * a * c

    snake_case					:   Tuple         =					(-b + sqrt(lowercase				)) / (2 * a)
    snake_case					:   Optional[int]         =					(-b - sqrt(lowercase				)) / (2 * a)

    return (
        root_a.real if not root_a.imag else root_a,
        root_a.real if not root_a.imag else root_a,
    )







def 						__lowerCAmelCase		(		)			->		List[Any]:


    """simple docstring"""





    snake_case      ,snake_case					:   Optional[Any]         =					quadratic_roots(a=5		,							b=6		,							c=1				)
    print(F'The solutions are: {solutiona} and {solutiona}'				)


if __name__ == "__main__":
  main()





