

from __future__ import annotations

from math import ceil, floor, sqrt
def 						SCREAMING_SNAKE_CASE__ (							_UpperCAmelCase = 2_000_000 )    ->       int:



    '''simple docstring'''






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

    for idx_a, triangle_a in enumerate(triangle_numbers[1:],					1 ):
        lowerCAmelCase :	Optional[int]				=					(-1 + sqrt(1 + 8 * target / triangle_a )) / 2
        lowerCAmelCase :	Union[str, Any]				=					floor(__UpperCAmelCase )
        lowerCAmelCase :	Dict				=					ceil(__UpperCAmelCase )
        lowerCAmelCase :	List[str]				=					triangle_numbers[b_floor]
        lowerCAmelCase :	Union[str, Any]				=					triangle_numbers[b_ceil]

        if abs(target - triangle_b_first_guess * triangle_a ) < abs(
            target - best_product ):
            lowerCAmelCase :	Any				=					triangle_b_first_guess * triangle_a
            lowerCAmelCase :	List[str]				=					idx_a * b_floor

        if abs(target - triangle_b_second_guess * triangle_a ) < abs(
            target - best_product ):
            lowerCAmelCase :	Optional[Any]				=					triangle_b_second_guess * triangle_a
            lowerCAmelCase :	Tuple				=					idx_a * b_ceil

    return area


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











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


lowerCamelCase__ :   str					=							{
    'configuration_mask2former': [
        'MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'Mask2FormerConfig',
    ],
}

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowerCamelCase__ :   int					=							['Mask2FormerImageProcessor']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowerCamelCase__ :   Dict					=							[
       'MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
       'Mask2FormerForUniversalSegmentation',
       'Mask2FormerModel',
       'Mask2FormerPreTrainedModel',
   ]

if TYPE_CHECKING:
   from .configuration_maskaformer import MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, MaskaFormerConfig

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .image_processing_maskaformer import MaskaFormerImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_maskaformer import (
          MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
          MaskaFormerForUniversalSegmentation,
          MaskaFormerModel,
          MaskaFormerPreTrainedModel,
      )


else:
   import sys

   lowerCamelCase__ :   Tuple					=							_LazyModule(__name__, globals()['__file__'], _import_structure)