
"""simple docstring"""




from __future__ import annotations

from math import ceil, floor, sqrt



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

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

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

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

		return area


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

"""simple docstring"""




from __future__ import annotations

import typing
from collections import Counter



def        _lowerCamelCase ( __a    ):
		SCREAMING_SNAKE_CASE_						 = Counter()
		for base in range(1,							max_perimeter + 1    ):
				for perpendicular in range(__a,							max_perimeter + 1    ):
						SCREAMING_SNAKE_CASE_						 = (base * base + perpendicular * perpendicular) ** 0.5
						if hypotenuse == int(__a    ):
								SCREAMING_SNAKE_CASE_						 = int(base + perpendicular + hypotenuse    )
								if perimeter > max_perimeter:
										continue
								triplets[perimeter] += 1
		return triplets



def        _lowerCamelCase ( __a = 1_000    ):
		SCREAMING_SNAKE_CASE_						 = pythagorean_triple(__a    )
		return triplets.most_common(1    )[0][0]


if __name__ == "__main__":
						print(f'''Perimeter {solution()} has maximum solutions''')