//Author: AKSHAY VASANDANI FROM JAYPEE INSTITUTE OF INFORMATION TECHNOLOGY //#include //#include #define ll long long #define gcd __gcd #include #define fi first #define se second #define mod 1000000007 #define pb push_back #define N 100001 #define eb emplace_back #define gc getchar_unlocked //#include //#define bigint boost::multiprecision::cpp_int using namespace std; /*using namespace __gnu_pbds; typedef tree< int, null_type, less, rb_tree_tag, tree_order_statistics_node_update> ordered_set; */ ll p(ll a,ll b) { ll temp; if(b==0) return 1; temp=p(a,b/2)%mod; if(b&1) return (((a*temp)%mod)*temp)%mod; else return (temp*temp)%mod; } ll p1(ll a,ll b) { ll temp; if(b==0) return 1; temp=p1(a,b/2); if(b&1) return (((a*temp))*temp); else return (temp*temp); } int m,q,u,h,t,k,a,b,c,d; int n,s,de,f,e,g,cnt,l,x,y,r,mi,ma; int i,j,num,ans1,ans,sq; int ar[1000001]; int main() { cin>>n; for(i=0;i>ar[i]; sort(ar,ar+n); reverse(ar,ar+n); ll ans=0; for(i=0;i