






'''simple docstring'''





from __future__ import annotations

from math import ceil, floor, sqrt



def        __snake_case						(__UpperCAmelCase = 2000000    ):





	"""simple docstring"""
	lowerCamelCase_					:  list[int]						=    [0]
	lowerCamelCase_					:  int

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

	for idx_a, triangle_a in enumerate(triangle_numbers[1:]       ,	1    ):
		lowerCamelCase_					:  int						=    (-1 + sqrt(1 + 8 * target / triangle_a    )) / 2
		lowerCamelCase_					:  Optional[int]						=    floor(SCREAMING_SNAKE_CASE__    )
		lowerCamelCase_					:  int						=    ceil(SCREAMING_SNAKE_CASE__    )
		lowerCamelCase_					:  Optional[Any]						=    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_					:  str						=    triangle_b_first_guess * triangle_a
			lowerCamelCase_					:  int						=    idx_a * b_floor

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

	return area


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








'''simple docstring'''
from typing import TYPE_CHECKING

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


lowercase__						       =      {"configuration_encoder_decoder": ["EncoderDecoderConfig"]}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowercase__						       =      ["EncoderDecoderModel"]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowercase__						       =      ["TFEncoderDecoderModel"]

try:
						if not is_flax_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowercase__						       =      ["FlaxEncoderDecoderModel"]

if TYPE_CHECKING:
						from .configuration_encoder_decoder import EncoderDecoderConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_encoder_decoder import EncoderDecoderModel

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_encoder_decoder import TFEncoderDecoderModel

						try:
												if not is_flax_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_flax_encoder_decoder import FlaxEncoderDecoderModel

else:
						import sys

						lowercase__						       =      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


