Problem: Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.

Constraints

* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.

Input


n
x1 y1
x2 y2
:
xn yn


The first integer n is the number of points in g.

In the following lines, the coordinate of the i-th point pi is given by two real numbers xi and yi. The coordinates of points are given in the order of counter-clockwise visit of them. Each value is a real number with at most 6 digits after the decimal point.

Output

Print the diameter of g in a line. The output values should be in a decimal fraction with an error less than 0.000001.

Examples

Input

3
0.0 0.0
4.0 0.0
2.0 2.0


Output

4.00


Input

4
0.0 0.0
1.0 0.0
1.0 1.0
0.0 1.0


Output

1.414213562373

Solution (in CPP):

Solution:
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <complex>
using namespace std;


constexpr double EPS = 1e-10;
using Point = complex<double>;
using Line  = pair<Point, Point>;
using Polygon = vector<Point>;
bool compare(const Point &a, const Point &b) { // x ascending order
    if(a.real() != b.real()) return a.real() < b.real();
    return a.imag() < b.imag();
};

double dot(Point p, Point q) { return (conj(p) * q).real(); }
double cross(Point p, Point q) { return (conj(p) * q).imag(); }

Polygon convex_hull(Polygon &ps) {
    sort(ps.begin(), ps.end(), compare);
    int n = (int)ps.size(), k = 0;
    Polygon res(n * 2);

    // use "< -EPS" if include corner or boundary, otherwise, use "< EPS"
    for(int i = 0; i < n; res[k++] = ps[i++]) 
        while(k >= 2 && cross(res[k-1] - res[k-2], ps[i] - res[k-1]) < -EPS) --k; 

    for(int i = n - 2, t = k+1; i >= 0; res[k++] = ps[i--])
        while(k >= t && cross(res[k-1] - res[k-2], ps[i] - res[k-1]) < -EPS) --k;

    res.resize(k - 1);
    return res;
}

double caliper(Polygon &ps) {
    ps = convex_hull(ps);
    int n = (int)ps.size();
    if(n == 2) {return abs(ps[0] - ps[1]);}
    
    int i = 0, j = 0;
    // j --> (x asc order) --> i
    for(int k=0; k < n; ++k) {
        if(compare(ps[i],ps[k])) i = k;
        if(compare(ps[k],ps[j])) j = k;
    }

    int si = i, sj = j;
    double res = 0.0;
    // rotate 180 degrees
    while(i != sj || j != si) {
        res = max(res, abs(ps[i] - ps[j]));
        if(cross(ps[(i + 1) % n] - ps[i], ps[(j + 1) % n] - ps[j]) < 0) {
            i = (i + 1) % n;
        } else {
            j = (j + 1) % n;
        }
    }

    return res;
}


int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int n; cin >> n;
    cout << fixed << setprecision(10);
    Polygon ps;
    for(int i=0; i < n; ++i) {
        double x,y;cin >> x >> y;
        ps.emplace_back(x,y);
    }
    cout << caliper(ps) << '\n';
    return 0;
}