Language: C++

#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;

void mainmain(){
	int n;
	cin>>n;
	vector<pll> v(n);
	rep(i,3){
		cin>>v[i].F>>v[i].S;
	}
	ll ans=0;
	while(v.size()!=1){
		// rep(i,v.size()){
			// cout<<v[i].F<<" "<<v[i].S<<endl;
		// }
		// cout<<endl;
		ll x=-1,y=0;
		rep(i,v.size()-1){
			if(y<v[i].F*v[i+1].S){
				x=i;
				y=v[i].F*v[i+1].S;
			}
			if(y<v[i].S*v[i+1].F){
				x=i;
				y=v[i].S*v[i+1].F;
			}
		}
		ans+=v[x].F*v[x].S*v[x+1].F*v[x+1].S;
		if(v[x].F*v[x+1].S>v[x].S*v[x+1].F) v[x]=mkp(v[x+1].F,v[x].S);
		else v[x]=mkp(v[x].F,v[x+1].S);
		reep(i,x+1,v.size()-1){
			swap(v[i],v[i+1]);
		}
		v.pop_back();
	}
	cout<<ans<<endl;
}



}
main() try{
    mainmain();
}
catch(...){
}

Compiler output:
a.cc: In function 'void {anonymous}::mainmain()':
a.cc:91:9: error: 'll' was not declared in this scope; did you mean 'vll'?
   91 |         ll ans=0;
      |         ^~
      |         vll
a.cc:97:19: error: expected ';' before 'x'
   97 |                 ll x=-1,y=0;
      |                   ^~
      |                   ;
a.cc:99:28: error: 'y' was not declared in this scope
   99 |                         if(y<v[i].F*v[i+1].S){
      |                            ^
a.cc:100:33: error: 'x' was not declared in this scope
  100 |                                 x=i;
      |                                 ^
a.cc:103:28: error: 'y' was not declared in this scope
  103 |                         if(y<v[i].S*v[i+1].F){
      |                            ^
a.cc:104:33: error: 'x' was not declared in this scope
  104 |                                 x=i;
      |                                 ^
a.cc:108:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
  108 |                 ans+=v[x].F*v[x].S*v[x+1].F*v[x+1].S;
      |                 ^~~
      |                 abs
a.cc:108:24: error: 'x' was not declared in this scope
  108 |                 ans+=v[x].F*v[x].S*v[x+1].F*v[x+1].S;
      |                        ^
a.cc:116:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
  116 |         cout<<ans<<endl;
      |               ^~~
      |               abs
a.cc: At global scope:
a.cc:122:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  122 | main() try{
      | ^~~~