

from __future__ import annotations

from math import ceil, floor, sqrt
def      a      (			A__	:   int = 2000000     )    ->      int:





      """simple docstring"""



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

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

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

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

      return area


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





from .imports import is_tqdm_available


if is_tqdm_available():
  from tqdm.auto import tqdm as _tqdm

from ..state import PartialState
def      a      (			A__	:   bool = True      ,   *A__	:   int      ,   **A__	:   Union[str, Any]     )    ->      List[str]:





      """simple docstring"""



      if not is_tqdm_available():
            raise ImportError('Accelerate\'s `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.'     )
      _lowercase	       =False
      if main_process_only:
            _lowercase	       =PartialState().local_process_index == 0
      return _tqdm(*A__      ,   **A__      ,   disable=A__     )


