



def    lowerCAmelCase_  (lowerCAmelCase__:		list[int]     ):





			"""simple docstring"""


			UpperCAmelCase_:		Union[str, Any]       			=    len(lowerCAmelCase__     )
			if n in (0, 1):
						return 0
			return sum(query * (n - i - 1) for i, query in enumerate(sorted(lowerCAmelCase__     )     )     )


if __name__ == "__main__":
	import doctest

	doctest.testmod()











import decimal







def    lowerCAmelCase_  ():





			"""simple docstring"""


			UpperCAmelCase_:		Union[str, Any]       			=    0
			UpperCAmelCase_:		Optional[Any]       			=    decimal.Context(prec=1_0_5     )
			for i in range(2		,	1_0_0     ):
						UpperCAmelCase_:		str       			=    decimal.Decimal(lowerCAmelCase__     )
						UpperCAmelCase_:		Any       			=    number.sqrt(lowerCAmelCase__     )
						if len(str(lowerCAmelCase__     )     ) > 1:
									answer += int(str(lowerCAmelCase__     )[0]     )
									UpperCAmelCase_:		str       			=    str(lowerCAmelCase__     )[2:1_0_1]
									answer += sum(int(lowerCAmelCase__     ) for x in sqrt_number_str     )
			return answer


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	print(F'''{solution() = }''')






