Advertisement
a53

ProdMax1

a53
Nov 7th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4. int n,x[100000];
  5. long long P;
  6.  
  7. int main()
  8. {
  9. cin>>n;
  10. for(int i=0;i<n;++i)
  11. cin>>x[i];
  12. sort(x,x+n);
  13. if(1ULL*x[n-1]*x[n-2]>1ULL*x[0]*x[1])
  14. cout<<1ULL*x[n-1]*x[n-2];
  15. else
  16. cout<<1ULL*x[0]*x[1];
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement