#include using namespace std; int main(){ int n,j=0; cin >> n; vector calories(n); for(int calories_i = 0; calories_i < n; calories_i++){ cin >> calories[calories_i]; } // your code goes here sort(calories.begin(),calories.end()); long long int miles=0; for(int i=n-1;i>=0;i--) { miles+=(calories[i]*pow(2,j)); j++; } cout<