/* hack46a.cpp This new file Created on 14-02-2017 at 21:32:13 Created By Gautam Kumar */ #include using namespace std; #define mod 1000000007 #define ll long long int ll modpow(ll a,ll b) { if(b==0) return 1; if(b==1) return a; ll temp = modpow(a,b/2); temp*=temp; //temp%=c; if(b%2==1) temp*=a; //temp%=c; return temp; } ll a[45]; int main() { int n; cin>>n; int i; for(i=0;i>a[i]; sort(a,a+n); int j = 0; //int i; ll sum = 0; for(i=n-1;i>=0;i--) { ll res = modpow(2,j); res *= a[i]; sum += res; j++; } cout<