


"""simple docstring"""



def     UpperCAmelCase    (					_lowercase   :      int  )	->   bool:


	"""simple docstring"""




	lowerCAmelCase_			       = 9

	while num > 0:
		if num % 1_0 != digit:
			return False
		num //= 1_0_0
		digit -= 1

	return True
def     UpperCAmelCase    (					)	->   int:


	"""simple docstring"""




	lowerCAmelCase_			       = 1_3_8_9_0_2_6_6_3

	while not is_square_form(num * num  ):
		if num % 1_0 == 3:
			num -= 6  # (3 - 6) % 10 = 7
		else:
			num -= 4  # (7 - 4) % 10 = 3

	return num * 1_0


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



"""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()