

from __future__ import annotations

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





def 					__lowerCamelCase	( ):







							'''simple docstring'''






							snake_case_							=    [randint(-1000   ,							1000      ) for i in range(10      )]
							snake_case_							=    randint(-5000   ,							5000      )
							return (arr, r)


_UpperCAmelCase		:   List[str]										=       make_dataset()





def 					__lowerCamelCase	( UpperCamelCase__   ,							UpperCamelCase__      ):







							'''simple docstring'''






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





def 					__lowerCamelCase	( UpperCamelCase__   ,							UpperCamelCase__      ):







							'''simple docstring'''






							arr.sort()
							snake_case_							=    len(UpperCamelCase__      )
							for i in range(n - 1      ):
														snake_case_				,    snake_case_							=    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	( ):







							'''simple docstring'''






							snake_case_							=    '\nfrom __main__ import dataset, triplet_sum1, triplet_sum2\n'
							snake_case_							=    '\ntriplet_sum1(*dataset)\n'
							snake_case_							=    '\ntriplet_sum2(*dataset)\n'
							snake_case_							=    repeat(setup=UpperCamelCase__   ,							stmt=UpperCamelCase__   ,							repeat=5   ,							number=10000      )
							snake_case_							=    repeat(setup=UpperCamelCase__   ,							stmt=UpperCamelCase__   ,							repeat=5   ,							number=10000      )
							return (min(UpperCamelCase__      ), min(UpperCamelCase__      ))


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

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







def 					__lowerCamelCase	( UpperCamelCase__      ):







							'''simple docstring'''






							if edge <= 0 or not isinstance(UpperCamelCase__   ,							UpperCamelCase__      ):
														raise ValueError('Length must be a positive.'      )
							return 3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)





def 					__lowerCamelCase	( UpperCamelCase__      ):







							'''simple docstring'''






							if edge <= 0 or not isinstance(UpperCamelCase__   ,							UpperCamelCase__      ):
														raise ValueError('Length must be a positive.'      )
							return ((15 + (7 * (5 ** (1 / 2)))) / 4) * (edge**3)


if __name__ == "__main__":
					import doctest

					doctest.testmod()




