import core.thread; import std.conv, std.stdio, std.string; import std.algorithm, std.array, std.bigint, std.container, std.math, std.range, std.regex; // Input class EOFException : Throwable { this() { super("EOF"); } } string[] tokens; string readToken() { for (; tokens.empty; ) { tokens = readln.split; if (tokens.empty && stdin.eof) throw new EOFException; } auto token = tokens[0]; tokens.popFront; return token; } int readInt() { return to!int(readToken); } long readLong() { return to!long(readToken); } real readReal() { return to!real(readToken); } // chmin/chmax void chmin(T)(ref T t, in T f) { if (t > f) t = f; } void chmax(T)(ref T t, in T f) { if (t < f) t = f; } // Pair struct Pair(S, T) { S x; T y; int opCmp( const Pair p) const { return (x < p.x) ? -1 : (x > p.x) ? +1 : (y < p.y) ? -1 : (y > p.y) ? +1 : 0; } int opCmp(ref const Pair p) const { return (x < p.x) ? -1 : (x > p.x) ? +1 : (y < p.y) ? -1 : (y > p.y) ? +1 : 0; } string toString() const { return "(" ~ to!string(x) ~ ", " ~ to!string(y) ~ ")"; } } auto pair(S, T)(inout(S) x, inout(T) y) { return Pair!(S, T)(x, y); } // Array int binarySearch(T)(in T[] as, in bool delegate(T) test) { int low = -1, upp = cast(int)(as.length); for (; low + 1 < upp; ) { int mid = (low + upp) >> 1; (test(as[mid]) ? low : upp) = mid; } return upp; } int lowerBound(T)(in T[] as, in T val) { return as.binarySearch((T a) { return (a < val); }); } int upperBound(T)(in T[] as, in T val) { return as.binarySearch((T a) { return (a <= val); }); } T[] unique(T)(in T[] as) { T[] bs; foreach (a; as) if (bs.empty || bs[$ - 1] != a) bs ~= a; return bs; } int root(int[] uf, int u) { return (uf[u] < 0) ? u : (uf[u] = uf.root(uf[u])); } bool conn(int[] uf, int u, int v) { u = uf.root(u); v = uf.root(v); if (u == v) return false; if (uf[u] > uf[v]) swap(u, v); uf[u] += uf[v]; uf[v] = u; return true; } int N; int[] X, Y; int det(int a, int b, int c, int d) { return (X[b] - X[a]) * (Y[d] - Y[c]) - (Y[b] - Y[a]) * (X[d] - X[c]); } int tri(int a, int b, int c) { return det(a, b, a, c); } real dist(int a, int b) { return (cast(real)((X[b] - X[a])^^2 + (Y[b] - Y[a])^^2))^^0.5; } real diameter(int[] us) { us.sort!((a, b) => (X[a] < X[b])); int[] vs; foreach (u; us) { for (; vs.length > 1 && tri(vs[$ - 2], vs[$ - 1], u) <= 0; vs.popBack) {} vs ~= u; } const r = vs.length; foreach_reverse (u; us) { for (; vs.length > r && tri(vs[$ - 2], vs[$ - 1], u) <= 0; vs.popBack) {} vs ~= u; } if (vs.length > 1) { vs.popBack; } debug{ writeln("vs = ",vs); } real ret = 0.0; for (int i = 0, j = 1; ; ) { chmax(ret, dist(vs[i % $], vs[j % $])); if (i + 1 == j) { ++j; } else if (j + 1 == i + vs.length) { ++i; } else if (det(vs[i % $], vs[(i + 1) % $], vs[j % $], vs[(j + 1) % $]) > 0) { ++j; } else { ++i; } if (i == vs.length) { break; } } return ret; } void main(string[] args) { Pair!(int, int)[] dirs; foreach (dx; -10 .. +10 + 1) foreach (dy; -10 .. +10 + 1) if (pair(dx, dy) > pair(0, 0)) { if (dx^^2 + dy^^2 <= 10^^2) { dirs ~= pair(dx, dy); } } debug{ writeln("dirs.length = ",dirs.length); } try { for (; ; ) { N = readInt; X = new int[N]; Y = new int[N]; foreach (i; 0 .. N) { X[i] = readInt; Y[i] = readInt; } int encode(int x, int y) { return x * 20000 + y; } /* int[int] ids; foreach (i; 0 .. N) { ids[encode(X[i], Y[i])] = i; } */ auto ps = new Pair!(int, int)[N]; foreach (i; 0 .. N) { ps[i] = pair(encode(X[i], Y[i]), i); } ps.sort(); int[] uf = new int[N]; uf[] = -1; /* foreach (i; 0 .. N) { foreach (dir; dirs) { const key = encode(X[i] + dir.x, Y[i] + dir.y); if (key in ids) { uf.conn(i, ids[key]); } int pos = ps.lowerBound(pair(key, -1)); if (pos < N && ps[pos].x == key) { uf.conn(i, ps[pos].y); } } } */ foreach (dir; dirs) { const diff = encode(dir.x, dir.y); for (int j = 0, k = 0; j < N && k < N; ) { if (ps[k].x - ps[j].x == diff) { debug{ writeln("conn ",ps[j].y," ",ps[k].y); } uf.conn(ps[j].y, ps[k].y); } if (ps[k].x - ps[j].x < diff) { ++k; } else { ++j; } } } int[][] uss = new int[][N]; foreach (u; 0 .. N) { uss[uf.root(u)] ~= u; } debug{ writeln("uss = ",uss); } real ans = 1.0; foreach (us; uss) { if (!us.empty) { const res = diameter(us); chmax(ans, res + 2.0); } } writefln("%.10f", ans); } } catch (EOFException) {} }