output_description: Print the maximum possible area of the rectangle. If no rectangle can be
  formed, print 0.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 A_2 ... A_N
attempt: // Created by sz
  #include <bits/stdc++.h>
  using namespace std;
  
  const int N = 1e5 + 5;
  int n;
  map<long long, int> cnt;
  
  
  int main(){
  #ifdef LOCAL
      freopen("./input.txt", "r", stdin);
  #endif
      ios_base::sync_with_stdio(false);
      cin.tie(0);
      
      cin>>n;
      long long x;
      for (int i = 1; i <= n; i++){
          cin>>x;
          cnt[x] ++;
      }
      
      vector<long long> sid;
      vector<long long> sid4;
      for (auto i = cnt.rbegin(); i != cnt.rend(); i++){
          if(i->second >=4)sid4.push_back(i->first);
          if(i->second >=2)sid.push_back(i->first);
      }
      
      long long mx = 0;
      
      if(sid4.size()>0)mx = max(mx, sid4[0]*sid4[0]);
      
      if(sid.size()>=2)mx = max(mx, sid[0]*sid[1]);
      
      if(sid4.size()>0 && sid.size()>0)mx = max(mx, sid4[0]*sid[0]);
      
      cout<<mx<<endl;
      
      
      return 0;
  }
  
  
  
problem_description: Statement
  
  We have N sticks with negligible thickness. The length of the i-th stick is
  A_i.
  
  Snuke wants to select four different sticks from these sticks and form a
  rectangle (including a square), using the sticks as its sides. Find the
  maximum possible area of the rectangle.
samples: [{"input": "6\n    3 1 2 4 2 1", "output": "2\n    \n\n1 \\times 2 rectangle can be formed.\n\n* * *"}, {"input": "4\n    1 2 3 4", "output": "0\n    \n\nNo rectangle can be formed.\n\n* * *"}, {"input": "10\n    3 3 3 3 4 4 4 5 5 5", "output": "20"}]