using namespace std;
const int N = 1e5 + 10;
int main()
{
ios::sync_with_stdio(false);
int n;
cin >> n;
priority_queue
int a = heap.top();heap.pop();int b = heap.top();heap.pop();heap.push(a + b);res += a + b;}cout << res << endl;return 0;
} ```
