실버3 문제
n = int(input()) arr = list(map(int, input().split())) answer = [] ssum = 0 arr.sort() for i in range(n): ssum = ssum + arr[i] answer.append(ssum) print(sum(answer))