#include using namespace std; typedef long long ll; #define pb push_back #define mp make_pair #define N 1001 #define PI acos(-1.0) #define M (ll)1e18 int main() { vectorv; ll n; cin>>n; for(ll i=0;i>a; v.pb(a); } sort(v.rbegin(),v.rend()); ll res=0; for(ll i=0;i