#include using namespace std; #define sqr(x) (x) * (x) #define all(x) (x).begin(), (x).end() #define fi first #define se second typedef long long ll; typedef long double ld; typedef unsigned long long ull; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ull n; cin >>n; vector a(n); for (ull i = 0; i < n; i++) cin >>a[i]; ull sum = 0; sort(all(a)); reverse(all(a)); ull bi = 1; for (ull i = 0; i < n; i++) { sum += bi * a[i]; bi *= 2; } cout <