'''simple docstring'''





from __future__ import annotations

from math import ceil, floor, sqrt



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: int = 2_00_00_00			)							->      Optional[Any]:







  """simple docstring"""





  SCREAMING_SNAKE_CASE__    							=   [0]
  SCREAMING_SNAKE_CASE__    							=   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
  SCREAMING_SNAKE_CASE__    							=   0
  # the area corresponding to the grid that gives the product closest to target
  SCREAMING_SNAKE_CASE__    							=   0
  # an estimate of b, using the quadratic formula
  SCREAMING_SNAKE_CASE__    							=   42
  # the largest integer less than b_estimate
  SCREAMING_SNAKE_CASE__    							=   42
  # the largest integer less than b_estimate
  SCREAMING_SNAKE_CASE__    							=   42
  # the triangle number corresponding to b_floor
  SCREAMING_SNAKE_CASE__    							=   42
  # the triangle number corresponding to b_ceil
  SCREAMING_SNAKE_CASE__    							=   42

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

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

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

  return area


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

import enum
import shutil
import sys


__lowerCamelCase     ,		__lowerCamelCase    :				Optional[Any]							     =	shutil.get_terminal_size()

__lowerCamelCase    :				Any							     =	{'''UP''': '''A''', '''DOWN''': '''B''', '''RIGHT''': '''C''', '''LEFT''': '''D'''}







class __snake_case       (		enum.Enum	):
   lowerCAmelCase_														=							0
   lowerCAmelCase_														=							1





def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: Optional[int]				,  __UpperCamelCase					: List[str]=""			)							->      int:







  """simple docstring"""





  sys.stdout.write(str(__UpperCamelCase			) + end			)
  sys.stdout.flush()



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: Optional[int]				,  __UpperCamelCase					: List[str]				,  __UpperCamelCase					: Optional[Any]=""			)							->      Dict:







  """simple docstring"""





  forceWrite(f"""\u001b[{color}m{content}\u001b[0m"""				,  __UpperCamelCase			)



def 			__SCREAMING_SNAKE_CASE						(      )							->      Optional[Any]:







  """simple docstring"""





  forceWrite("""\r"""			)



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: int				,  __UpperCamelCase					: str			)							->      str:







  """simple docstring"""





  forceWrite(f"""\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}"""			)



def 			__SCREAMING_SNAKE_CASE						(      )							->      Dict:







  """simple docstring"""





  forceWrite(""" """ * TERMINAL_WIDTH			)
  reset_cursor()






def 			__SCREAMING_SNAKE_CASE						(      )							->      int:







  """simple docstring"""





  reset_cursor()
  forceWrite("""-""" * TERMINAL_WIDTH			)
