






"""simple docstring"""





def 					lowerCamelCase__	(							_lowerCamelCase	:		list[int]			)				->    int:
  lowerCamelCase_   					=						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()












"""simple docstring"""





from __future__ import annotations

from random import randrange







def 					lowerCamelCase__	(							_lowerCamelCase	:		list			)				->    list:
  if len(_lowerCamelCase			) < 2:
    return collection
  lowerCamelCase_   					=						randrange(len(_lowerCamelCase			)			)  # Use random element as pivot
  lowerCamelCase_   					=						collection[pivot_index]
  lowerCamelCase_   					=						[]  # All elements greater than pivot
  lowerCamelCase_   					=						[]  # All elements less than or equal to pivot

  for element in collection[:pivot_index]:
    (greater if element > pivot else lesser).append(_lowerCamelCase			)

  for element in collection[pivot_index + 1 :]:
    (greater if element > pivot else lesser).append(_lowerCamelCase			)

  return [*quick_sort(_lowerCamelCase			), pivot, *quick_sort(_lowerCamelCase			)]


if __name__ == "__main__":
  _SCREAMING_SNAKE_CASE :    Dict    =						input('''Enter numbers separated by a comma:\n''').strip()
  _SCREAMING_SNAKE_CASE :    List[str]    =						[int(item) for item in user_input.split(''',''')]
  print(quick_sort(unsorted))




