作者:
Liyb
,
2022-08-04 18:08:12
,
所有人可见
,
阅读 3
//枚举一个点,找和它横坐标相等的最大点和纵坐标相等的最大点
//在所有方案中取最优解
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 110;
typedef pair<int, int> PII;
#define x first
#define y second
PII q[N];
int main()
{
int n;cin >> n;
for(int i = 0; i < n; i ++)
{
int x,y;cin >> x >> y;
q[i] = {x, y};
}
int res = 0;
for(int i = 0; i < n; i ++)
{
int a = 0,b = 0;
for(int j = 0; j < n; j ++)
{
if(q[i].x == q[j].x)a = max(a, abs(q[j].y - q[i].y));
if(q[i].y == q[j].y)b = max(b, abs(q[j].x - q[i].x));
}
res = max(res, a * b);
}
printf("%d\n",res);
return 0;
}