


from __future__ import annotations

import typing
from collections import Counter
def 				UpperCAmelCase_					(							__snake_case						)     ->			typing.Counter[int]:







 """simple docstring"""


 _lowercase							      =Counter()
 for base in range(1     ,						max_perimeter + 1						):
  for perpendicular in range(__snake_case     ,						max_perimeter + 1						):
   _lowercase							      =(base * base + perpendicular * perpendicular) ** 0.5
   if hypotenuse == int(__snake_case						):
    _lowercase							      =int(base + perpendicular + hypotenuse						)
    if perimeter > max_perimeter:
     continue
    triplets[perimeter] += 1
 return triplets
def 				UpperCAmelCase_					(							__snake_case = 1000						)     ->			int:







 """simple docstring"""


 _lowercase							      =pythagorean_triple(__snake_case						)
 return triplets.most_common(1						)[0][0]


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





from typing import Union

import fire
import torch
from tqdm import tqdm



def 	lowerCAmelCase       (						lowerCAmelCase_       ,      lowerCAmelCase_ = "cpu"       ,      lowerCAmelCase_ = None       )->       None:
				lowerCAmelCase_       :					str			 = torch.load(lowerCAmelCase_       ,      map_location=lowerCAmelCase_       )
				for k, v in tqdm(state_dict.items()       ):
								if not isinstance(lowerCAmelCase_       ,      torch.Tensor       ):
												raise TypeError('''FP16 conversion only works on paths that are saved state dicts, like pytorch_model.bin'''       )
								lowerCAmelCase_       :					int			 = v.half()
				if save_path is None:  # overwrite src_path
								lowerCAmelCase_       :					Tuple			 = src_path
				torch.save(lowerCAmelCase_       ,      lowerCAmelCase_       )


if __name__ == "__main__":
						fire.Fire(convert)