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>
using namespace std;
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cassert>
#include<iomanip>

typedef double type_n;

struct Point{ type_n x, y; };

Point set_p(type_n a, type_n b)
{
    Point p;
    p.x = a; p.y = b;
    return p;
}

struct Vector{ type_n vx, vy; };

Vector set_v(const Point &p1, const Point &p2)
{
    Vector v;
    v.vx = p2.x - p1.x;
    v.vy = p2.y - p1.y;
    return v;
}

type_n cross(const Vector &v1, const Vector &v2)
{
    return (v1.vx * v2.vy) - (v1.vy * v2.vx);
}

type_n dist(const Point &p1, const Point &p2)
{
    return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}

int main()
{
    int i, n;
    type_n *X, *Y;
    scanf("%d", &n);
    assert(n >= 3);

    X = new type_n [n + 1];
    Y = new type_n [n + 1];
    for(i = 0; i < n; i++){
        scanf("%lf %lf", &X[i], &Y[i]);
    }
    X[n] = X[0], Y[n] = Y[0];

    Point *Plg;
    Plg = new Point [n + 1];
    for(i = 0; i <= n; i++){
        Plg[i] = set_p(X[i], Y[i]);
    }

    int top = 0, bottom = 0;
    type_n diam = 0;
    type_n low = Y[0], high = Y[0];

    for(i = 1; i < n; i++){
        if(low > Y[i]){ bottom = i, low = Y[i]; }
        if(high < Y[i]){ top = i, high = Y[i]; }
    }
    diam = dist(Plg[top], Plg[bottom]);
    top--;

    for(int k = 0; k < n; k++){
        while(cross(set_v(Plg[bottom], Plg[bottom + 1]), set_v(Plg[top], Plg[top + 1])) >= 0){
            top++; if(top > n - 1) top -= n;
        };
        diam = max(diam, max(dist(Plg[bottom], Plg[top]), dist(Plg[bottom + 1], Plg[top])));
        bottom++; if(bottom > n - 1) bottom -= n;
    }

    printf("%.12f\n", diam);

    return 0;
}