

'''simple docstring'''







from __future__ import annotations

from itertools import permutations
from random import randint
from timeit import repeat
def  UpperCAmelCase__      ( )     ->     tuple[list[int], int]:
       A_		   = [randint(-10_00,    10_00			) for i in range(10			)]
       A_		   = randint(-50_00,    50_00			)
       return (arr, r)


__lowerCamelCase						    =      make_dataset()
def  UpperCAmelCase__      ( UpperCAmelCase__,    UpperCAmelCase__			)     ->     tuple[int, ...]:
       for triplet in permutations(UpperCAmelCase__,    3			):
              if sum(UpperCAmelCase__			) == target:
                     return tuple(sorted(UpperCAmelCase__			)			)
       return (0, 0, 0)
def  UpperCAmelCase__      ( UpperCAmelCase__,    UpperCAmelCase__			)     ->     tuple[int, int, int]:
       arr.sort()
       A_		   = len(UpperCAmelCase__			)
       for i in range(n - 1			):
              A_   ,     A_		   = 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  UpperCAmelCase__      ( )     ->     tuple[float, float]:
       A_		   = """
from __main__ import dataset, triplet_sum1, triplet_sum2
"""
       A_		   = """
triplet_sum1(*dataset)
"""
       A_		   = """
triplet_sum2(*dataset)
"""
       A_		   = repeat(setup=UpperCAmelCase__,    stmt=UpperCAmelCase__,    repeat=5,    number=1_00_00			)
       A_		   = repeat(setup=UpperCAmelCase__,    stmt=UpperCAmelCase__,    repeat=5,    number=1_00_00			)
       return (min(UpperCAmelCase__			), min(UpperCAmelCase__			))


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

      testmod()
      __lowerCamelCase						    =      solution_times()
      print(f"""The time for naive implementation is {times[0]}.""")
      print(f"""The time for optimized implementation is {times[1]}.""")



'''simple docstring'''







def  UpperCAmelCase__      ( UpperCAmelCase__ = 10_00			)     ->     int:
       return sum(2 * a * ((a - 1) // 2) for a in range(3,    n + 1			)			)


if __name__ == "__main__":
      print(solution())
