#include #define MAX 100005 #define ll long long #define gc getchar_unlocked #define pc putchar_unlocked #define SRT int t;cin>>t;while(t--) #define FAST ios_base::sync_with_stdio(false) #define mp make_pair using namespace std; ll power(ll x, ll n){ if(n==0) return 1; if(n%2==0) return power((x*x),n/2); else return (x*(power((x*x),(n-1)/2))); } int main(){ FAST; int n; cin>>n; int a[n]; for(int i=0;i>a[i]; ll sum=0,j=0; sort(a,a+n); for(int i=n-1;i>=0;--i){ sum+=a[i]*power(2,j); ++j; } cout<