






"""simple docstring"""







from __future__ import annotations

from math import ceil, floor, sqrt

def _a			(		_snake_case = 200_0000							):







      """simple docstring"""






      UpperCAmelCase          =	[0]
      UpperCAmelCase          =	42

      for idx in range(1				,	ceil(sqrt(target * 2							) * 1.1							)							):
            triangle_numbers.append(triangle_numbers[-1] + idx							)

      # we want this to be as close as possible to target
      UpperCAmelCase          =	0
      # the area corresponding to the grid that gives the product closest to target
      UpperCAmelCase          =	0
      # an estimate of b, using the quadratic formula
      UpperCAmelCase          =	42
      # the largest integer less than b_estimate
      UpperCAmelCase          =	42
      # the largest integer less than b_estimate
      UpperCAmelCase          =	42
      # the triangle number corresponding to b_floor
      UpperCAmelCase          =	42
      # the triangle number corresponding to b_ceil
      UpperCAmelCase          =	42

      for idx_a, triangle_a in enumerate(triangle_numbers[1:]				,	1							):
            UpperCAmelCase          =	(-1 + sqrt(1 + 8 * target / triangle_a							)) / 2
            UpperCAmelCase          =	floor(_snake_case							)
            UpperCAmelCase          =	ceil(_snake_case							)
            UpperCAmelCase          =	triangle_numbers[b_floor]
            UpperCAmelCase          =	triangle_numbers[b_ceil]

            if abs(target - triangle_b_first_guess * triangle_a							) < abs(
                target - best_product							):
                  UpperCAmelCase          =	triangle_b_first_guess * triangle_a
                  UpperCAmelCase          =	idx_a * b_floor

            if abs(target - triangle_b_second_guess * triangle_a							) < abs(
                target - best_product							):
                  UpperCAmelCase          =	triangle_b_second_guess * triangle_a
                  UpperCAmelCase          =	idx_a * b_ceil

      return area


if __name__ == "__main__":
  print(F"""{solution() = }""")











"""simple docstring"""







from __future__ import annotations

def _a			(		_snake_case				,	_snake_case = None				,	_snake_case = None							):







      """simple docstring"""






      if start is None:
            UpperCAmelCase          =	0

      if end is None:
            UpperCAmelCase          =	len(_snake_case							) - 1

      if start >= end:
            return

      UpperCAmelCase          =	(start + end) // 2

      slowsort(_snake_case				,	_snake_case				,	_snake_case							)
      slowsort(_snake_case				,	mid + 1				,	_snake_case							)

      if sequence[end] < sequence[mid]:
            UpperCAmelCase      , UpperCAmelCase          =	sequence[mid], sequence[end]

      slowsort(_snake_case				,	_snake_case				,	end - 1							)


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

  testmod()



