# 题目分析

$AC \times AB=(X_C-X_A)(Y_B-Y_A)-(X_B-X_A)(Y_C-Y_A)=$
$(Y_B-Y_A)X_C+(X_A-X_B)Y_C-X_AY_B+X_BY_A$

# 代码

#include<bits/stdc++.h>
using namespace std;
#define RI register int
int q=0;char ch=' ';
while(ch<'0'||ch>'9') ch=getchar();
while(ch>='0'&&ch<='9') q=q*10+ch-'0',ch=getchar();
return q;
}
const int N=71,inf=0x3f3f3f3f;
struct point{int x,y;};
int a[N][N],b[N][N],g[N][N];
int visa[N],visb[N],cp[N],dl[N],expa[N],expb[N];
int T,n;

int dfs(int x) {
visa[x]=1;
for(RI i=1;i<=n;++i) {
if(visb[i]) continue;
int kl=expa[x]+expb[i]-g[x][i];
if(kl==0) {
visb[i]=1;
if(!cp[i]||dfs(cp[i])) {cp[i]=x;return 1;}
}
else dl[i]=min(dl[i],kl);
}
return 0;
}
point km() {
for(RI i=1;i<=n;++i) expb[i]=cp[i]=0;
for(RI i=1;i<=n;++i) {
expa[i]=-inf;
for(RI j=1;j<=n;++j) expa[i]=max(expa[i],g[i][j]);
}
for(RI i=1;i<=n;++i) {
for(RI j=1;j<=n;++j) dl[j]=inf;
while("niconiconi") {
for(RI j=1;j<=n;++j) visa[j]=visb[j]=0;
if(dfs(i)) break;
int kl=inf;
for(RI j=1;j<=n;++j) if(!visb[j]) kl=min(kl,dl[j]);
for(RI j=1;j<=n;++j) {
if(visa[j]) expa[j]-=kl;
if(visb[j]) expb[j]+=kl;
else dl[j]-=kl;
}
}
}
point re=(point){0,0};
for(RI i=1;i<=n;++i) re.x+=a[cp[i]][i],re.y+=b[cp[i]][i];
return re;
}
int work(point l,point r) {
for(RI i=1;i<=n;++i)
for(RI j=1;j<=n;++j) g[i][j]=a[i][j]*(r.y-l.y)+b[i][j]*(l.x-r.x);
point mid=km();
if((l.x==mid.x&&l.y==mid.y)||(r.x==mid.x&&r.y==mid.y))
return min(l.x*l.y,r.x*r.y);
else return min(work(l,mid),work(mid,r));
}
int main()
{
while(T--) {
for(RI i=1;i<=n;++i)
for(RI i=1;i<=n;++i)
for(RI i=1;i<=n;++i)
for(RI j=1;j<=n;++j) g[i][j]=-a[i][j];
point L=km();
for(RI i=1;i<=n;++i)
for(RI j=1;j<=n;++j) g[i][j]=-b[i][j];
point R=km();
printf("%d\n",work(L,R));
}
return 0;
}