





'''simple docstring'''






from itertools import combinations, product







def 				_a	(					_lowerCamelCase						,  _lowerCamelCase						,  _lowerCamelCase						,  _lowerCamelCase   )   ->							bool:



			"""simple docstring"""


			if xa == ya == 0 or xa == ya == 0:
						return False
			__snake_case				:			Dict       			=    xa * xa + ya * ya
			__snake_case				:			Optional[int]       			=    xa * xa + ya * ya
			__snake_case				:			int       			=    (xa - xa) * (xa - xa) + (ya - ya) * (ya - ya)
			return (
			    a_square + b_square == c_square
			    or a_square + c_square == b_square
			    or b_square + c_square == a_square
			)







def 				_a	(					_lowerCamelCase = 50   )   ->							int:



			"""simple docstring"""


			return sum(
			    1
			    for pta, pta in combinations(product(range(limit + 1   )						,  repeat=2   )						,  2   )
			    if is_right(*_lowerCamelCase						,  *_lowerCamelCase   )   )


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









'''simple docstring'''






import torch
from torch import autograd




class    _A   (				autograd.Function		):

		@staticmethod
		def   lowercase__    (      __magic_name__				:      List[Any]     ,			__magic_name__				:      torch.tensor     ,			__magic_name__				:      float     ,			__magic_name__				:      bool )				->						Optional[int]:


					"""simple docstring"""

					__snake_case				:			List[Any]       			=    inputs.numel()
					__snake_case				:			List[Any]       			=    int(0.005 * nb_elems ) + 1
					if sigmoid:
								__snake_case				:			Dict       			=    (torch.sigmoid(__magic_name__ ) > threshold).type(inputs.type() )
					else:
								__snake_case				:			Tuple       			=    (inputs > threshold).type(inputs.type() )
					if mask.sum() < nb_min:
								# We limit the pruning so that at least 0.5% (half a percent) of the weights are remaining
								__snake_case				:			Tuple       			=    inputs.flatten().kthvalue(max(nb_elems - nb_min     ,			1 ) ).values
								__snake_case				:			Union[str, Any]       			=    (inputs > k_threshold).type(inputs.type() )
					return mask

		@staticmethod
		def   lowercase__    (      __magic_name__				:      int     ,			__magic_name__				:      Any )				->						Tuple:


					"""simple docstring"""

					return gradOutput, None, None





class    _A   (				autograd.Function		):

		@staticmethod
		def   lowercase__    (      __magic_name__				:      Tuple     ,			__magic_name__				:      torch.tensor     ,			__magic_name__				:      float )				->						int:


					"""simple docstring"""

					__snake_case				:			Tuple       			=    inputs.clone()
					__snake_case			,    __snake_case				:			Dict       			=    inputs.flatten().sort(descending=__magic_name__ )
					__snake_case				:			List[Any]       			=    int(threshold * inputs.numel() )

					# flat_out and mask access the same memory.
					__snake_case				:			Optional[Any]       			=    mask.flatten()
					__snake_case				:			List[str]       			=    0
					__snake_case				:			Any       			=    1
					return mask

		@staticmethod
		def   lowercase__    (      __magic_name__				:      List[str]     ,			__magic_name__				:      Any )				->						Optional[Any]:


					"""simple docstring"""

					return gradOutput, None





class    _A   (				__lowercase		):

		@staticmethod
		def   lowercase__    (      __magic_name__				:      torch.tensor     ,			__magic_name__				:      float )				->						List[str]:


					"""simple docstring"""

					__snake_case				:			List[str]       			=    inputs.clone()
					__snake_case			,    __snake_case				:			Tuple       			=    inputs.abs().flatten().sort(descending=__magic_name__ )
					__snake_case				:			Any       			=    int(threshold * inputs.numel() )

					# flat_out and mask access the same memory.
					__snake_case				:			Union[str, Any]       			=    mask.flatten()
					__snake_case				:			Tuple       			=    0
					__snake_case				:			int       			=    1
					return mask


