



from __future__ import annotations

from math import ceil, floor, sqrt




def      UpperCAmelCase__			(				__snake_case = 2_000_000				) ->			int:
  _A							     =     [0]
  _A							     =     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
  _A							     =     0
  # the area corresponding to the grid that gives the product closest to target
  _A							     =     0
  # an estimate of b, using the quadratic formula
  _A							     =     42
  # the largest integer less than b_estimate
  _A							     =     42
  # the largest integer less than b_estimate
  _A							     =     42
  # the triangle number corresponding to b_floor
  _A							     =     42
  # the triangle number corresponding to b_ceil
  _A							     =     42

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

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

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

  return area


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



'''simple docstring'''
class        lowerCAmelCase_  :






       def __init__( self			,     _UpperCamelCase   )->      None:
            _A				=							size
            _A				=							[0] * size
            _A				=							[0] * size






       @staticmethod
       def   UpperCamelCase						( _UpperCamelCase   )->      int:
            return index | (index + 1)






       @staticmethod
       def   UpperCamelCase						( _UpperCamelCase   )->      int:
            return (index & (index + 1)) - 1






       def   UpperCamelCase						( self			,     _UpperCamelCase			,     _UpperCamelCase   )->      None:
            _A				=							value
            while index < self.size:
                 _A				=							self.get_prev(_UpperCamelCase   ) + 1
                 if current_left_border == index:
                      _A				=							value
                 else:
                      _A				=							max(_UpperCamelCase			,     _UpperCamelCase			,     _UpperCamelCase   )
                 _A				=							self.get_next(_UpperCamelCase   )






       def   UpperCamelCase						( self			,     _UpperCamelCase			,     _UpperCamelCase   )->      int:
            right -= 1  # Because of right is exclusive
            _A				=							0
            while left <= right:
                 _A				=							self.get_prev(_UpperCamelCase   )
                 if left <= current_left:
                      _A				=							max(_UpperCamelCase			,     self.tree[right]   )
                      _A				=							current_left
                 else:
                      _A				=							max(_UpperCamelCase			,     self.arr[right]   )
                      right -= 1
            return result


if __name__ == "__main__":
    import doctest

    doctest.testmod()





