






"""simple docstring"""
from __future__ import annotations

from math import ceil, floor, sqrt

def        snake_case   (     A__ = 2_00_00_00		):
			UpperCAmelCase_  :				list[int]      =      [0]
			UpperCAmelCase_  :				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
			UpperCAmelCase_  :				int      =      0
			# the area corresponding to the grid that gives the product closest to target
			UpperCAmelCase_  :				int      =      0
			# an estimate of b, using the quadratic formula
			UpperCAmelCase_  :				float
			# the largest integer less than b_estimate
			UpperCAmelCase_  :				int
			# the largest integer less than b_estimate
			UpperCAmelCase_  :				int
			# the triangle number corresponding to b_floor
			UpperCAmelCase_  :				int
			# the triangle number corresponding to b_ceil
			UpperCAmelCase_  :				int

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

						if abs(target - triangle_b_second_guess * triangle_a		) < abs(
						    target - best_product		):
									UpperCAmelCase_  :				Tuple      =      triangle_b_second_guess * triangle_a
									UpperCAmelCase_  :				Any      =      idx_a * b_ceil

			return area


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











"""simple docstring"""
from itertools import count

def        snake_case   (     A__ = 50		):
			UpperCAmelCase_  :				Any      =      [1] * min_block_length

			for n in count(A__		):
						fill_count_functions.append(1		)

						for block_length in range(A__			,n + 1		):
									for block_start in range(n - block_length		):
												fill_count_functions[n] += fill_count_functions[
												    n - block_start - block_length - 1
												]

									fill_count_functions[n] += 1

						if fill_count_functions[n] > 1_00_00_00:
									break

			return n


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



