#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long long n, i, res = 0; cin >> n; vector vec(n); for(i = 0; i < n; i++) cin >> vec[i]; sort(vec.rbegin(), vec.rend()); i = 0; for(auto x: vec) res += x*(1LL<