from itertools import combinations, product

def 	__lowerCamelCase							(				__a    : int      ,							__a    : int      ,							__a    : int      ,							__a    : int		)      ->       bool:
	if xa == ya == 0 or xa == ya == 0:
		return False
	_lowercase   =xa * xa + ya * ya
	_lowercase   =xa * xa + ya * ya
	_lowercase   =(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 	__lowerCamelCase							(				__a    : int = 50		)      ->       int:
	return sum(
	    1
	    for pta, pta in combinations(product(range(limit + 1		)      ,							repeat=2		)      ,							2		)
	    if is_right(*__a      ,							*__a		)		)


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





"""simple docstring"""







def 	a__   (		UpperCAmelCase__							:      list[int]      )->						int:
						UpperCAmelCase__       						=		len(UpperCAmelCase__      )
						if n in (0, 1):
												return 0
						return sum(query * (n - i - 1) for i, query in enumerate(sorted(UpperCAmelCase__      )      )      )


if __name__ == "__main__":
						import doctest

						doctest.testmod()

