


"""simple docstring"""



from scipy.constants import g
def     UpperCAmelCase    (					_lowercase   :      List[str] ,      _lowercase   :      Tuple  )	->   Any:


	"""simple docstring"""




	if mass < 0:
		# handling of negative values of mass
		raise ValueError('''The mass of a body cannot be negative'''  )
	if height < 0:
		# handling of negative values of height
		raise ValueError('''The height above the ground cannot be negative'''  )
	return mass * g * height


if __name__ == "__main__":
			from doctest import testmod

			testmod(name='potential_energy')



"""simple docstring"""



def     UpperCAmelCase    (					_lowercase   :      list[int]  )	->   int:


	"""simple docstring"""




	lowerCAmelCase_			       = len(_lowercase  )
	if n in (0, 1):
		return 0
	return sum(query * (n - i - 1) for i, query in enumerate(sorted(_lowercase  )  )  )


if __name__ == "__main__":
		import doctest

		doctest.testmod()