#include #include using namespace std; int main(){ vector a; int N,temp; scanf("%d",&N); for(int i=0;i<2*N;i++){ scanf("%d",&temp); a.push_back(temp); } sort(a.begin(),a.end()); int ans = 0; for(int i=0;i<2*N;i+=2){ ans += a[i]*a[i+1]; } printf("%d",ans); }