#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
int arr[n];
for(int i = 0;i < n;i++){
cin >> arr[i];
}
sort(arr,arr+n);
int sum = 0;
for(int i = 0;i < n;i++){
sum += arr[i]*(n-i);
}
cout << a;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: