






"""simple docstring"""




from __future__ import annotations

from math import ceil, floor, sqrt

def   snake_case (UpperCAmelCase__ = 2_0_0_0_0_0_0  )	->    List[Any]:
  UpperCamelCase_: Any   				=    [0]
  UpperCamelCase_: Optional[int]   				=    4_2

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

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

    if abs(target - triangle_b_first_guess * triangle_a  ) < abs(
        target - best_product  ):
      UpperCamelCase_: int   				=    triangle_b_first_guess * triangle_a
      UpperCamelCase_: Optional[int]   				=    idx_a * b_floor

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

  return area


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







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


A_		:		Tuple		     =			{
    'configuration_funnel': ['FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP', 'FunnelConfig'],
    'convert_funnel_original_tf_checkpoint_to_pytorch': [],
    'tokenization_funnel': ['FunnelTokenizer'],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_		:		List[str]		     =			['FunnelTokenizerFast']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_		:		List[str]		     =			[
       'FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST',
       'FunnelBaseModel',
       'FunnelForMaskedLM',
       'FunnelForMultipleChoice',
       'FunnelForPreTraining',
       'FunnelForQuestionAnswering',
       'FunnelForSequenceClassification',
       'FunnelForTokenClassification',
       'FunnelModel',
       'FunnelPreTrainedModel',
       'load_tf_weights_in_funnel',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_		:		str		     =			[
       'TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST',
       'TFFunnelBaseModel',
       'TFFunnelForMaskedLM',
       'TFFunnelForMultipleChoice',
       'TFFunnelForPreTraining',
       'TFFunnelForQuestionAnswering',
       'TFFunnelForSequenceClassification',
       'TFFunnelForTokenClassification',
       'TFFunnelModel',
       'TFFunnelPreTrainedModel',
   ]


if TYPE_CHECKING:
   from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
   from .tokenization_funnel import FunnelTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_funnel_fast import FunnelTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_funnel import (
          FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
          FunnelBaseModel,
          FunnelForMaskedLM,
          FunnelForMultipleChoice,
          FunnelForPreTraining,
          FunnelForQuestionAnswering,
          FunnelForSequenceClassification,
          FunnelForTokenClassification,
          FunnelModel,
          FunnelPreTrainedModel,
          load_tf_weights_in_funnel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_funnel import (
          TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFFunnelBaseModel,
          TFFunnelForMaskedLM,
          TFFunnelForMultipleChoice,
          TFFunnelForPreTraining,
          TFFunnelForQuestionAnswering,
          TFFunnelForSequenceClassification,
          TFFunnelForTokenClassification,
          TFFunnelModel,
          TFFunnelPreTrainedModel,
      )

else:
   import sys

   A_		:		Any		     =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)