#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Point; // 定义点的类型,使用long long存储坐标
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n; // 输入点的数量
vector<Point> points(n);
for (int i = 0; i < n; ++i) {
cin >> points[i].first >> points[i].second; // 输入每个点的坐标
}
vector<Point> hull = convexHull(points); // 构建凸包
cout << rotatingCalipers(hull) << endl; // 计算并输出凸包直径的平方
return 0;
}