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