"""simple docstring"""



from __future__ import annotations

import typing
from collections import Counter

def  _A(		lowerCAmelCase							):
							A__       :     typing.Counter[int]								=			Counter()
							for base in range(1			,  max_perimeter + 1							):
														for perpendicular in range(lowerCAmelCase			,  max_perimeter + 1							):
																					A__       :     Union[str, Any]								=			(base * base + perpendicular * perpendicular) ** 0.5
																					if hypotenuse == int(lowerCAmelCase							):
																												A__       :     Optional[int]								=			int(base + perpendicular + hypotenuse							)
																												if perimeter > max_perimeter:
																																			continue
																												triplets[perimeter] += 1
							return triplets

def  _A(		lowerCAmelCase = 1000							):
							A__       :     List[Any]								=			pythagorean_triple(lowerCAmelCase							)
							return triplets.most_common(1							)[0][0]


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






"""simple docstring"""



def  _A(		lowerCAmelCase			,  lowerCAmelCase							):
							A__       :     List[Any]								=			[1]
							for i in range(2			,  lowerCAmelCase							):
														factorials.append(factorials[-1] * i							)
							assert 0 <= k < factorials[-1] * n, "k out of bounds"

							A__       :     Union[str, Any]								=			[]
							A__       :     int								=			list(range(lowerCAmelCase							)							)

							# Find permutation
							while factorials:
														A__       :     Optional[int]								=			factorials.pop()
														A__				,							A__       :     Union[str, Any]								=			divmod(lowerCAmelCase			,  lowerCAmelCase							)
														permutation.append(elements[number]							)
														elements.remove(elements[number]							)
							permutation.append(elements[0]							)

							return permutation


if __name__ == "__main__":
				import doctest

				doctest.testmod()





