#include #include #include #include #include using namespace std; typedef long long ll; const int MAXN = 100; int n, a[MAXN]; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); reverse(a, a + n); ll ans = 0; for (int i = 0; i < n; i++) ans += 1ll*a[i]*(1ll<