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