Keko has $N$ dots in a 2-D coordinate plane. He wants to measure the gap between the most distant two dots. To make the problem easier, Keko decided to change each dot's $\boldsymbol{x}$ or $y$ coordinate to zero.   

Help Keko calculate the distance!

Input Format

The first line contains an integer, $N$, the number of dots. 

The next $N$ lines each contain the integer coordinates of the dots in $(x,y)$ fashion.  

Constraints 

$2\leq N\leq10^6$ 

$-10^9\leq x_i,\ y_i\leq10^9$

It is guaranteed that all dots are distinct, and either their $\boldsymbol{x}$ or $y$ coordinate is equal to $0$.  

Output Format

Print the distance between the most distant dots with an absolute error of, at most, $\mathbf{10^{-6}}$.

Sample Input
4
-1 0
1 0
0 1
0 -1

Sample Output
2.000000

Explanation

In the sample, the most distant dots are located at $(-1,0)$ and $(1,0)$. 

The distance between them is $2$.

Source: hackerrank | Difficulty: EASY
Tags: Mathematics


Solutions:
read = lambda : map(int, input().split())
(n,) = read()
(xs, ys) = ([], [])
for _ in range(n):
	(x, y) = read()
	if y == 0:
		xs.append(x)
	else:
		ys.append(y)
xs.sort()
ys.sort()
ret = 0
if len(xs) > 0:
	ret = max(ret, (xs[-1] - xs[0]) ** 2)
if len(ys) > 0:
	ret = max(ret, (ys[-1] - ys[0]) ** 2)
if len(xs) > 0 and len(ys) > 0:
	xx = max((abs(v) for v in xs))
	yy = max((abs(v) for v in ys))
	ret = max(ret, xx ** 2 + yy ** 2)
print(ret ** 0.5)


from math import sqrt
n = int(input())
(min_x, max_x, min_y, max_y) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = tuple(map(float, input().split()))
	if x < min_x:
		min_x = x
	if x > max_x:
		max_x = x
	if y < min_y:
		min_y = y
	if y > max_y:
		max_y = y
opts = (min_x, max_x, min_y, max_y)
res = max([max_x - min_x, max_y - min_y, sqrt(max_x ** 2 + max_y ** 2), sqrt(max_x ** 2 + min_y ** 2), sqrt(min_x ** 2 + max_y ** 2), sqrt(min_x ** 2 + min_y ** 2)])
print(res)


import math
N = int(input())
x_axis = []
y_axis = []
for _ in range(N):
	(x, y) = map(int, input().split())
	if x == 0:
		y_axis.append(y)
	if y == 0:
		x_axis.append(x)
x_axis.sort()
y_axis.sort()
if not x_axis:
	print(y_axis[-1] - y_axis[0])
elif not y_axis:
	print(x_axis[-1] - x_axis[0])
else:
	(xmin, xmax) = (x_axis[0], x_axis[-1])
	(ymin, ymax) = (y_axis[0], y_axis[-1])
	d = max((xmin * xmin + ymin * ymin, xmax * xmax + ymin * ymin, xmin * xmin + ymax * ymax, xmax * xmax + ymax * ymax))
	d = max(math.sqrt(d), x_axis[-1] - x_axis[0], y_axis[-1] - y_axis[0])
	print(d)


import math

def dist(x, y):
	return math.sqrt(x ** 2 + y ** 2)
n = int(input())
(Xl, Xr, Yd, Yt) = (1000000001, -1000000001, 1000000001, -1000000001)
for t in range(n):
	(x, y) = list(map(int, input().split()))
	if x == 0:
		if Yd > y:
			Yd = y
		if Yt < y:
			Yt = y
	if y == 0:
		if Xl > x:
			Xl = x
		if Xr < x:
			Xr = x
l = [Xr - Xl, Yt - Yd, dist(Xl, Yd), dist(Xl, Yt), dist(Xr, Yd), dist(Xr, Yt)]
print(max(l))


import sys
maxX = 0
minX = 0
maxY = 0
minY = 0
N = int(input().strip())
for i in range(N):
	arr = input().strip().split()
	if int(arr[0]) < minX:
		minX = int(arr[0])
	elif int(arr[0]) > maxX:
		maxX = int(arr[0])
	elif int(arr[1]) < minY:
		minY = int(arr[1])
	elif int(arr[1]) > maxY:
		maxY = int(arr[1])
d1 = (minX ** 2 + minY ** 2) ** 0.5
d2 = (minX ** 2 + maxY ** 2) ** 0.5
d3 = ((minX - maxX) ** 2) ** 0.5
d4 = ((minY - maxY) ** 2) ** 0.5
d5 = (minY ** 2 + maxX ** 2) ** 0.5
d6 = (maxY ** 2 + maxX ** 2) ** 0.5
print(max(d1, d2, d3, d4, d5, d6))


from math import sqrt
N = int(input())
(x, y) = [int(p) for p in input().split()]
x_min = x
x_max = x
y_min = y
y_max = y
for pt in range(N - 1):
	(x, y) = [int(p) for p in input().split()]
	if x < x_min:
		x_min = x
	if x > x_max:
		x_max = x
	if y < y_min:
		y_min = y
	if y > y_max:
		y_max = y
straigt_dists = max(y_max - y_min, x_max - x_min)
bigx = max(abs(x_min), abs(x_max))
bigy = max(abs(y_min), abs(y_max))
bigdist = max(sqrt(bigy ** 2 + bigx ** 2), straigt_dists)
print(bigdist)


import math

def main():
	n = int(input())
	xs = []
	ys = []
	for __ in range(n):
		(x, y) = [float(elem) for elem in input().strip().split(' ')]
		if x == 0:
			ys.append(y)
		if y == 0:
			xs.append(x)
	if not xs:
		diff = max(ys) - min(ys)
		print(float(diff))
		return
	if not ys:
		diff = max(ys) - min(ys)
		print(float(diff))
		return
	min_x = min(xs)
	max_x = max(xs)
	min_y = min(ys)
	max_y = max(ys)
	sols = []
	sols.append(max_x - min_x)
	sols.append(max_y - min_y)
	sols.append(math.sqrt(max_x ** 2 + max_y ** 2))
	sols.append(math.sqrt(min_x ** 2 + max_y ** 2))
	sols.append(math.sqrt(max_x ** 2 + min_y ** 2))
	sols.append(math.sqrt(min_x ** 2 + min_y ** 2))
	print(float(max(sols)))
main()


n = int(input())
maxUp = -1 * 10 ** 9
maxDown = 10 ** 9
maxRight = -1 * 10 ** 9
maxLeft = 10 ** 9
for i in range(n):
	inp = list(map(int, input().split(' ')))
	if inp[0] == 0:
		if inp[1] > maxUp:
			maxUp = inp[1]
		if inp[1] < maxDown:
			maxDown = inp[1]
	else:
		if inp[0] > maxRight:
			maxRight = inp[0]
		if inp[0] < maxLeft:
			maxLeft = inp[0]
check0 = abs(maxUp - maxDown)
check1 = abs(maxRight - maxLeft)
check2 = (maxUp ** 2 + maxRight ** 2) ** 0.5
check3 = (maxUp ** 2 + maxLeft ** 2) ** 0.5
check4 = (maxDown ** 2 + maxRight ** 2) ** 0.5
check5 = (maxDown ** 2 + maxLeft ** 2) ** 0.5
print(max(max(check0, check1), max(max(check2, check3), max(check4, check5))))


import math
nod = int(input())
biggestX = -10 ** 9
smallestX = 10 ** 9
biggestY = -10 ** 9
smallestY = 10 ** 9
for i in range(0, nod):
	temp = input().split()
	x = int(temp[0])
	y = int(temp[1])
	biggestX = max(biggestX, x)
	biggestY = max(biggestY, y)
	smallestX = min(smallestX, x)
	smallestY = min(smallestY, y)
maxd = max(biggestX - smallestX, biggestY - smallestY, math.sqrt(smallestX ** 2 + smallestY ** 2), math.sqrt(biggestX ** 2 + biggestY ** 2), math.sqrt(smallestX ** 2 + biggestY ** 2), math.sqrt(biggestX ** 2 + smallestY ** 2))
print(maxd)


from math import sqrt
N = int(input())
dots = []
(maxX, minX, maxY, minY) = (0, 0, 0, 0)
for _ in range(N):
	(x, y) = tuple((int(x) for x in input().split()))
	if x > maxX:
		maxX = x
	elif x < minX:
		minX = x
	elif y > maxY:
		maxY = y
	elif y < minY:
		minY = y

def distance(dot1, dot2):
	(x1, y1) = dot1
	(x2, y2) = dot2
	return sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
maxDistance = 0
dots = [(maxX, 0), (minX, 0), (0, maxY), (0, minY)]
for (i, dot1) in enumerate(dots):
	for dot2 in dots[i + 1:]:
		dist = distance(dot1, dot2)
		if dist > maxDistance:
			maxDistance = dist
print(maxDistance)


import math
xmax = -1000000000
xmin = 1000000000
ymax = -1000000000
ymin = 1000000000
for i in range(int(input())):
	(x, y) = input().split(' ')
	(x, y) = (int(x), int(y))
	if x > xmax:
		xmax = x
	if x < xmin:
		xmin = x
	if y > ymax:
		ymax = y
	if y < ymin:
		ymin = y
maxdistance = 0
if xmax - xmin > maxdistance:
	maxdistance = xmax - xmin
if ymax - ymin > maxdistance:
	maxdistance = ymax - ymin
if math.sqrt(ymax ** 2 + xmax ** 2) > maxdistance:
	maxdistance = math.sqrt(ymax ** 2 + xmax ** 2)
if math.sqrt(ymax ** 2 + xmin ** 2) > maxdistance:
	maxdistance = math.sqrt(ymax ** 2 + xmin ** 2)
if math.sqrt(ymin ** 2 + xmax ** 2) > maxdistance:
	maxdistance = math.sqrt(ymin ** 2 + xmax ** 2)
if math.sqrt(ymin ** 2 + xmin ** 2) > maxdistance:
	maxdistance = math.sqrt(ymin ** 2 + xmin ** 2)
print(maxdistance)


import math
n = int(input().strip())
maxX = -10000000000
maxY = -10000000000
minX = 10000000000
minY = 10000000000

def dist(coord1, coord2):
	return math.sqrt((coord1[0] - coord2[0]) ** 2 + (coord1[1] - coord2[1]) ** 2)
for _ in range(n):
	(x, y) = map(int, input().strip().split(' '))
	if x < minX:
		minX = x
	if x > maxX:
		maxX = x
	if y < minY:
		minY = y
	if y > maxY:
		maxY = y
print(max([dist((0, maxY), (minX, 0)), dist((0, maxY), (maxX, 0)), dist((0, maxY), (0, minY)), dist((0, minY), (minX, 0)), dist((0, minY), (maxX, 0)), dist((maxX, 0), (minX, 0))]))


def distance(x1, y1, x2, y2):
	return ((x1 - x2) ** 2 + (y2 - y1) ** 2) ** (1 / 2)
t = int(input())
left = 0
right = 0
top = 0
bottom = 0
for _ in range(0, t):
	(x, y) = map(int, input().split())
	if y == 0:
		if x < left and x < 0:
			left = x
		elif x > right and x > 0:
			right = x
	elif y > top and y > 0:
		top = y
	elif y < bottom and y < 0:
		bottom = y
d = []
d.append(distance(0, top, right, 0))
d.append(distance(0, top, left, 0))
d.append(distance(0, top, 0, bottom))
d.append(distance(0, bottom, right, 0))
d.append(distance(0, bottom, left, 0))
d.append(distance(right, 0, left, 0))
print(max(d))


from math import sqrt
N = int(input().strip())
(negX, posX, negY, posY) = (0, 0, 0, 0)
for _ in range(N):
	[x, y] = [int(_) for _ in input().strip().split()]
	(negX, posX) = (min(negX, x), max(posX, x))
	(negY, posY) = (min(negY, y), max(posY, y))
	dist = max(posX - negX, posY - negY, sqrt(posX * posX + posY * posY), sqrt(posX * posX + negY * negY), sqrt(negX * negX + posY * posY), sqrt(negX * negX + negY * negY))
print(dist)


from math import sqrt
from itertools import product

def dist(x, y):
	return (y[1] - x[1]) ** 2 + (y[0] - x[0]) ** 2
n = int(input())
l = [tuple(map(int, input().split())) for i in range(n)]
miny = min((y for (x, y) in l if x == 0))
maxy = max((y for (x, y) in l if x == 0))
minx = min((x for (x, y) in l if y == 0))
maxx = max((x for (x, y) in l if y == 0))
newl = [(0, miny), (0, maxy), (minx, 0), (maxx, 0)]
print(sqrt(max((dist(x, y) for (x, y) in product(newl, newl)))))


def main():
	n = int(input())
	maxX = -10000000000000
	maxY = -10000000000000
	minX = 10000000000000
	minY = 10000000000000
	for i in range(n):
		(x, y) = map(int, input().split())
		if x < minX:
			minX = x
		elif x > maxX:
			maxX = x
		if y < minY:
			minY = y
		elif y > maxY:
			maxY = y
	max1 = max(maxX - minX, maxY - minY)
	max2 = max((maxX ** 2 + maxY ** 2) ** 0.5, (minX ** 2 + minY ** 2) ** 0.5)
	max3 = max((maxX ** 2 + minY ** 2) ** 0.5, (minX ** 2 + maxY ** 2) ** 0.5)
	max4 = max(max2, max3)
	print(max(max1, max4))
	return 0
main()


import math

def main():
	n = int(input())
	max_Posy = max_Posx = min_Negy = min_Negx = 0
	for _ in range(n):
		(x, y) = list(map(int, input().split()))
		if x < 0:
			min_Negx = min(min_Negx, x)
		else:
			max_Posx = max(max_Posx, x)
		if y < 0:
			min_Negy = min(min_Negy, y)
		else:
			max_Posy = max(max_Posy, y)
	distance = max(max_Posx - min_Negx, max_Posy - min_Negy)
	distance = max(distance, math.sqrt(min_Negx ** 2 + max_Posy ** 2))
	distance = max(distance, math.sqrt(min_Negx ** 2 + min_Negy ** 2))
	distance = max(distance, math.sqrt(max_Posx ** 2 + max_Posy ** 2))
	distance = max(distance, math.sqrt(max_Posx ** 2 + min_Negy ** 2))
	print(distance)
main()


xmin = 0
xmax = 0
ymin = 0
ymax = 0
n = int(input())
for i in range(n):
	s = input()
	x = int(s.split()[0])
	y = int(s.split()[1])
	if x > xmax:
		xmax = x
	if x < xmin:
		xmin = x
	if y > ymax:
		ymax = y
	if y < ymin:
		ymin = y
d1 = abs(xmax - xmin)
d2 = abs(ymax - ymin)
if d2 > d1:
	d1 = d2
y = max(abs(ymin), ymax)
x = max(abs(xmin), xmax)
d3 = (x ** 2 + y ** 2) ** 0.5
if d3 > d1:
	d1 = d3
print(d1)


import math
n = int(input())
x = []
y = []
for i in range(n):
	s1 = input()
	(a, b) = s1.split(' ')
	x.append(float(a))
	y.append(float(b))
a = min(x)
b = max(x)
c = min(y)
d = max(y)
q = []
q.append(abs(b - a))
q.append(abs(d - c))
q.append(math.sqrt(a ** 2 + c ** 2))
q.append(math.sqrt(a ** 2 + d ** 2))
q.append(math.sqrt(b ** 2 + c ** 2))
q.append(math.sqrt(b ** 2 + d ** 2))
print(max(q))


import math
n = int(input())
x = []
y = []
for i in range(n):
	dot = input().strip().split()
	if dot[0] == '0':
		y.append(int(dot[1]))
	else:
		x.append(int(dot[0]))
xmin = x[0]
xmax = x[0]
for elem in x:
	if elem < xmin:
		xmin = elem
	if elem > xmax:
		xmax = elem
ymin = y[0]
ymax = y[0]
for elem in y:
	if elem < ymin:
		ymin = elem
	if elem > ymax:
		ymax = elem
ydis = ymax - ymin
xdis = xmax - xmin
if xmin < 0:
	xmin = -xmin
if ymin < 0:
	ymin = -ymin
xabs = max(xmin, xmax)
yabs = max(ymin, ymax)
xydis = math.sqrt(xabs * xabs + yabs * yabs)
print(max(ydis, xdis, xydis))


from math import sqrt
N = int(input())
(max_x, max_y, min_x, min_y) = (-float('inf'), -float('inf'), float('inf'), float('inf'))
for _ in range(N):
	(x, y) = map(float, input().split())
	if x > max_x:
		max_x = x
	if x < min_x:
		min_x = x
	if y > max_y:
		max_y = y
	if y < min_y:
		min_y = y
distances = []
distances.append(max_x - min_x)
distances.append(max_y - min_y)
distances.append(sqrt(min_x ** 2 + min_y ** 2))
distances.append(sqrt(min_x ** 2 + max_y ** 2))
distances.append(sqrt(max_x ** 2 + min_y ** 2))
distances.append(sqrt(max_x ** 2 + max_y ** 2))
print(sorted(distances, reverse=True)[0])


from math import sqrt

def checkmost(most, newval):
	if most is None:
		return newval
	else:
		return newval if newval > most else most

def checkleast(least, newval):
	if least is None:
		return newval
	else:
		return newval if newval < least else least

def distxy(x, y):
	return sqrt(x * x + y * y)
n = int(input().strip())
umost = None
dmost = None
lmost = None
rmost = None
for _ in range(n):
	(x, y) = map(int, input().strip().split())
	if x == 0:
		umost = checkmost(umost, y)
		dmost = checkleast(dmost, y)
	if y == 0:
		lmost = checkleast(lmost, x)
		rmost = checkmost(rmost, x)
dists = [umost - dmost, rmost - lmost, distxy(umost, lmost), distxy(umost, rmost), distxy(dmost, lmost), distxy(dmost, rmost)]
mostdist = max(dists)
print('%.6f' % mostdist)


import math
N = int(input())
points = []
minx = maxx = miny = maxy = 0
for N_i in range(N):
	(x, y) = (int(x) for x in input().split())
	if x < minx:
		minx = x
	elif x > maxx:
		maxx = x
	elif y < miny:
		miny = y
	elif y > maxy:
		maxy = y
bestx = math.sqrt((maxx - minx) ** 2)
besty = math.sqrt((maxy - miny) ** 2)
bestcomb = math.sqrt(max(abs(minx), maxx) ** 2 + max(abs(miny), maxy) ** 2)
print(max(bestx, besty, bestcomb))


import sys
import math
t = int(input().strip())
x_max = -10 ** 9
x_min = 10 ** 9
y_max = -10 ** 9
y_min = 10 ** 9
for i in range(t):
	(_x, _y) = input().strip().split(' ')
	x = int(_x)
	y = int(_y)
	x_max = max(x, x_max)
	y_max = max(y, y_max)
	x_min = min(x, x_min)
	y_min = min(y, y_min)
d_x = abs(x_max - x_min)
d_y = abs(y_max - y_min)
d_diag = math.sqrt(max(x_max ** 2, x_min ** 2) + max(y_max ** 2, y_min ** 2))
result = max(d_x, max(d_y, d_diag))
print('{:06f}'.format(result))


(max_x, min_x, max_y, min_y) = (0, 0, 0, 0)
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x > max_x:
		max_x = x
	elif x < min_x:
		min_x = x
	if y > max_y:
		max_y = y
	elif y < min_y:
		min_y = y
print('{:.6f}'.format(max([max_x - min_x, max_y - min_y, (max([max_x, -min_x]) ** 2 + max([max_y, -min_y]) ** 2) ** 0.5])))


__author__ = 'Ward'
import math
N = int(input())
X = Y = False
(x, y) = map(int, input().split())
Up = Down = y
Left = Right = x
if x == 0:
	Y = True
if y == 0:
	X = True
for i in range(0, N - 1):
	(x, y) = map(int, input().split())
	Up = max(Up, y)
	Down = min(Down, y)
	Right = max(Right, x)
	Left = min(Left, x)
	if x == 0:
		Y = True
	if y == 0:
		X = True
ans = max(Up - Down, Right - Left)
if X and Y:
	ans = max(ans, math.sqrt(max(abs(Up), abs(Down)) ** 2 + max(abs(Left), abs(Right)) ** 2))
print(ans)


import math

def distance(p0, p1):
	return math.sqrt((p0[0] - p1[0]) ** 2 + (p0[1] - p1[1]) ** 2)
N = int(input())
(x1, x2, y1, y2) = (1000000000, -1000000000, 1000000000, -1000000000)
for i in range(N):
	(x, y) = map(int, input().strip().split())
	if x == 0:
		if y < y1:
			y1 = y
		if y > y2:
			y2 = y
	elif y == 0:
		if x < x1:
			x1 = x
		if x > x2:
			x2 = x
a = round(distance([x1, 0], [0, y2]), 6)
b = round(distance([0, y2], [x2, 0]), 6)
c = round(distance([x2, 0], [0, y1]), 6)
d = round(distance([0, y1], [x1, 0]), 6)
e = round(distance([x1, 0], [x2, 0]), 6)
f = round(distance([0, y1], [0, y2]), 6)
print(max(a, b, c, d, e, f))


import math
N = int(input())
coordinates = [int(arr_temp) for arr_temp in input().strip().split(' ')]
lowX = coordinates[0]
highX = coordinates[0]
lowY = coordinates[1]
highY = coordinates[1]
while N > 1:
	coordinates = [int(arr_temp) for arr_temp in input().strip().split(' ')]
	X = coordinates[0]
	Y = coordinates[1]
	if X == 0:
		if Y < lowY:
			lowY = Y
		if Y > highY:
			highY = Y
	if Y == 0:
		if X < lowX:
			lowX = X
		if X > highX:
			highX = X
	N -= 1
maxDistX = highX - lowX
maxDistY = highY - lowY
if highX > -1 * lowX:
	maxAbsX = highX
else:
	maxAbsX = lowX
if highY > -1 * lowY:
	maxAbsY = highY
else:
	maxAbsY = lowY
maxDistXY = math.sqrt(maxAbsX * maxAbsX + maxAbsY * maxAbsY)
print(max([maxDistX, maxDistY, maxDistXY]))


n = int(input())
d = []
(max_x, max_y, min_x, min_y) = (-1000000000, -1000000000, 1000000000, 1000000000)
while n:
	(X, Y) = list(map(int, input().split(' ')))
	if X > max_x:
		max_x = X
	if X < min_x:
		min_x = X
	if Y > max_y:
		max_y = Y
	if Y < min_y:
		min_y = Y
	n -= 1
d.append(max_x - min_x)
d.append(max_y - min_y)
(d1, d2, d3, d4) = (pow(max_x, 2), pow(min_x, 2), pow(max_y, 2), pow(min_y, 2))
d.append((d1 + d3) ** 0.5)
d.append((d1 + d4) ** 0.5)
d.append((d2 + d3) ** 0.5)
d.append((d2 + d4) ** 0.5)
print(round(max(d), 6))


import math
n = int(input())
arr1 = []
arr2 = []
for i in range(0, n):
	(a, b) = map(int, input().split())
	if a == 0:
		arr1.append(b)
	else:
		arr2.append(a)
arr1.sort()
arr2.sort()
max1 = 0
w = abs(arr1[0] - arr1[len(arr1) - 1])
x = abs(arr2[0] - arr2[len(arr2) - 1])
y = max(abs(arr2[0]), abs(arr2[len(arr2) - 1]))
z = max(abs(arr1[0]), abs(arr1[len(arr1) - 1]))
if w > x:
	max1 = w
else:
	max1 = x
if max1 < math.sqrt(y ** 2 + z ** 2):
	max1 = math.sqrt(y ** 2 + z ** 2)
print('{0:.6f}'.format(max1))


max_x = 0
max_y = 0
min_x = 0
min_y = 0
for i in range(int(input())):
	dot = list(map(int, input().split()))
	if dot[0] != 0:
		if dot[0] > max_x:
			max_x = dot[0]
			continue
		elif dot[0] < min_x:
			min_x = dot[0]
			continue
	elif dot[1] > max_y:
		max_y = dot[1]
		continue
	elif dot[1] < min_y:
		min_y = dot[1]
		continue
print(max(max_x - min_x, max_y - min_y, (max_x ** 2 + min_y ** 2) ** 0.5, (min_x ** 2 + max_y ** 2) ** 0.5, (max_x ** 2 + max_y ** 2) ** 0.5, (min_x ** 2 + min_y ** 2) ** 0.5))


t = int(input())

def distance_formula(a, b):
	(ax, ay) = a
	(bx, by) = b
	return ((bx - ax) ** 2 + (by - ay) ** 2) ** 0.5
xxx = []
yyy = []
for i in range(t):
	(x, y) = input().split()
	xxx.append(int(x))
	yyy.append(int(y))
maxDiff = 0
xmin = min(xxx)
xmax = max(xxx)
ymin = min(yyy)
ymax = max(yyy)
if xmax - xmin > maxDiff:
	maxDiff = xmax - xmin
if ymax - ymin > maxDiff:
	maxDiff = ymax - ymin
a = distance_formula((xmax, 0), (0, ymin))
if a > maxDiff:
	maxDiff = a
b = distance_formula((xmax, 0), (0, ymax))
if b > maxDiff:
	maxDiff = b
c = distance_formula((xmin, 0), (0, ymax))
if c > maxDiff:
	maxDiff = c
d = distance_formula((xmin, 0), (0, ymin))
if d > maxDiff:
	maxDiff = d
print(maxDiff)


import math
n = int(input())
arr1 = []
arr2 = []
for i in range(0, n):
	(a, b) = map(int, input().split())
	if a == 0:
		arr1.append(b)
	else:
		arr2.append(a)
arr1.sort()
arr2.sort()
max1 = 0
w = abs(arr1[0] - arr1[len(arr1) - 1])
x = abs(arr2[0] - arr2[len(arr2) - 1])
y = max(abs(arr2[0]), abs(arr2[len(arr2) - 1]))
z = max(abs(arr1[0]), abs(arr1[len(arr1) - 1]))
if w > x:
	max1 = w
else:
	max1 = x
if max1 < math.sqrt(y ** 2 + z ** 2):
	max1 = math.sqrt(y ** 2 + z ** 2)
print('{0:.6f}'.format(max1))


from math import sqrt
n = int(input())
(x, y) = (0, 0)
(xmin, xmax, ymin, ymax) = (10 ** 9, -10 ** 9, 10 ** 9, -10 ** 9)
for i in range(n):
	(u, v) = map(int, input().split())
	if xmin > u:
		xmin = u
	if xmax < u:
		xmax = u
	if ymin > v:
		ymin = v
	if ymax < v:
		ymax = v
	if u < 0:
		u = -u
	if v < 0:
		v = -v
	if x < u:
		x = u
	if y < v:
		y = v
ans = xmax - xmin
if ans < ymax - ymin:
	ans = ymax - ymin
if ans < sqrt(x * x + y * y):
	ans = sqrt(x * x + y * y)
print(ans)


from math import sqrt
N = int(input())
maxx = 0
maxy = 0
minx = 10 ** 9 + 1
miny = 10 ** 9 + 1
for _ in range(N):
	(x, y) = map(int, input().split())
	maxx = max(maxx, x)
	maxy = max(maxy, y)
	minx = min(minx, x)
	miny = min(miny, y)
maxabsx = max(abs(maxx), abs(minx))
maxabsy = max(abs(maxy), abs(miny))
c1 = sqrt(maxabsx ** 2 + maxabsy ** 2)
c2 = maxx - minx
c3 = maxy - miny
print(max(max(c1, c2), c3))


import math
n = int(input())
v1 = []
v2 = []
for i in range(0, n):
	(x, y) = map(int, input().split())
	if x == 0:
		v1.append(y)
	else:
		v2.append(x)
v1.sort()
v2.sort()
dst = 0
a = abs(v1[0] - v1[len(v1) - 1])
b = abs(v2[0] - v2[len(v2) - 1])
c = max(abs(v2[0]), abs(v2[len(v2) - 1]))
d = max(abs(v1[0]), abs(v1[len(v1) - 1]))
if a > b:
	dst = a
else:
	dst = b
if dst < math.sqrt(c ** 2 + d ** 2):
	dst = math.sqrt(c ** 2 + d ** 2)
print('{0:.6f}'.format(dst))


import sys, math
n = int(input().strip())
data = []
for a0 in range(n):
	arr = [float(arr_temp) for arr_temp in input().strip().split(' ')]
	data.append(arr)
xcoords = []
for x in data:
	if x[0] != 0:
		xcoords.append(x[0])
if xcoords == []:
	xcoords.append(0)
ycoords = []
for y in data:
	if y[1] != 0:
		ycoords.append(y[1])
if ycoords == []:
	ycoords.append(0)
xneg = min(xcoords)
xplus = max(xcoords)
yneg = min(ycoords)
yplus = max(ycoords)

def findMax(xneg, xplus, yneg, yplus):
	ac = xplus - xneg
	bd = yplus - yneg
	ab = math.sqrt(math.pow(xneg, 2) + math.pow(yplus, 2))
	ad = math.sqrt(math.pow(xneg, 2) + math.pow(yneg, 2))
	bc = math.sqrt(math.pow(yplus, 2) + math.pow(xplus, 2))
	cd = math.sqrt(math.pow(xplus, 2) + math.pow(yneg, 2))
	print(max(ac, bd, ab, ad, bc, cd))
findMax(xneg, xplus, yneg, yplus)


from itertools import combinations
from math import sqrt
xmax = -10 ** 10
xmin = 10 ** 10
ymax = -10 ** 10
ymin = 10 ** 10
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x == 0:
		if y > ymax:
			ymax = y
		if y < ymin:
			ymin = y
	else:
		if x > xmax:
			xmax = x
		if x < xmin:
			xmin = x
points = []
dist = 0
if xmax != -10 ** 10:
	points.append((xmax, 0))
if ymax != -10 ** 10:
	points.append((0, ymax))
if xmin != 10 ** 10:
	points.append((xmin, 0))
if ymin != 10 ** 10:
	points.append((0, ymin))

def distance(x1, x2, y1, y2):
	return sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
for i in combinations(points, 2):
	x1 = i[0][0]
	x2 = i[1][0]
	y1 = i[0][1]
	y2 = i[1][1]
	D = distance(x1, x2, y1, y2)
	if D > dist:
		dist = D
print(dist)


from math import sqrt

def main():
	N = int(input())
	dots = set()
	for i in range(N):
		(x, y) = [int(i) for i in input().split(' ')]
		dots.add((x, y))
	dot = dots.pop()
	xmax = xmin = dot[0]
	ymax = ymin = dot[1]
	for dot in dots:
		xmax = max(xmax, dot[0])
		xmin = min(xmin, dot[0])
		ymax = max(ymax, dot[1])
		ymin = min(ymin, dot[1])
	result = xmax - xmin
	result = max(ymax - ymin, result)
	result = max(sqrt(pow(max(xmax, abs(xmin)), 2) + pow(max(ymax, abs(ymin)), 2)), result)
	print(result)
main()


import math
import sys
n = int(input())
s = []
X = []
Y = []
for i in range(n):
	(x, y) = input().split()
	x = float(x)
	y = float(y)
	X.append(x)
	Y.append(y)
s.append(max(X) - min(X))
s.append(max(Y) - min(Y))
s.append(math.sqrt(max(X) ** 2 + max(Y) ** 2))
s.append(math.sqrt(max(X) ** 2 + min(Y) ** 2))
s.append(math.sqrt(min(X) ** 2 + max(Y) ** 2))
s.append(math.sqrt(min(X) ** 2 + min(Y) ** 2))
print(max(s))


import math

def dist(a, b):
	return math.sqrt(a ** 2 + b ** 2)
n = int(input().strip())
for i in range(n):
	arr = [int(x) for x in input().strip().split(' ')]
	try:
		big = (max(arr[0], big[0]), max(arr[1], big[1]))
		small = (min(arr[0], small[0]), min(arr[1], small[1]))
	except NameError:
		big = (arr[0], arr[1])
		small = (arr[0], arr[1])
print(max(big[0] - small[0], big[1] - small[1], dist(big[0], big[1]), dist(small[0], small[1]), dist(big[0], small[1]), dist(small[0], big[1])))


from math import sqrt
n = int(input())
x = []
y = []
for i in range(0, n):
	tmp = [int(z) for z in input().split(' ')]
	x.append(tmp[0])
	y.append(tmp[1])
mix = min(x) ** 2
mxx = max(x) ** 2
miy = min(y) ** 2
mxy = max(y) ** 2
print(max(abs(max(x) - min(x)), abs(max(y) - min(y)), sqrt(mix + miy), sqrt(mxx + mxy), sqrt(mix + mxy), sqrt(mxx + miy)))


from sys import maxsize
from math import hypot
n = int(input().strip())
(x1, x2, y1, y2) = (0, 0, 0, 0)
while n > 0:
	n -= 1
	t = tuple(map(int, input().split()))
	if t[1] == 0:
		if t[0] < 0:
			x1 = max(x1, abs(t[0]))
		else:
			x2 = max(x2, t[0])
	elif t[1] < 0:
		y1 = max(y1, abs(t[1]))
	else:
		y2 = max(y2, t[1])
res = max(hypot(x2, y2), hypot(x2, x1), hypot(x1, y2), hypot(x1, y1), x2 + x1, y2 + y1)
print(res)


import math

def dist(x1, x2):
	return x1 ** 2 + x2 ** 2

def max_dist(xmin, xmax, ymin, ymax):
	a = abs(xmax - xmin) ** 2
	b = abs(ymin - ymax) ** 2
	c = max(dist(xmin, ymin), dist(xmin, ymax), dist(xmax, ymin), dist(xmax, ymax))
	return math.sqrt(max(a, b, c))
t = int(input())
minx = maxx = miny = maxy = None
for i in range(t):
	(a, b) = [float(k) for k in input().strip().split()]
	if b == 0:
		if minx == None or maxx == None:
			minx = maxx = a
		elif a > maxx:
			maxx = a
		elif a < minx:
			minx = a
	elif miny == None or maxy == None:
		miny = maxy = b
	elif b > maxy:
		maxy = b
	elif b < miny:
		miny = b
print(max_dist(minx, maxx, miny, maxy))


from math import pow, sqrt
n = int(input().strip())
(xL, yL) = ([], [])
for i in range(n):
	(x, y) = [float(i) for i in input().strip().split()]
	xL.append(x)
	yL.append(y)
diag = sqrt(pow(max([abs(i) for i in xL]), 2) + pow(max([abs(i) for i in yL]), 2))
maxX = max(xL) - min(xL)
maxY = max(yL) - min(yL)
dist = max(diag, maxX, maxY)
print(dist)


n = int(input())
maxL = 0.0
maxR = 0.0
maxT = 0.0
maxB = 0.0
for _ in range(n):
	f = input().split()
	x = float(f[0])
	y = float(f[1])
	if x < maxL:
		maxL = x
	if x > maxR:
		maxR = x
	if y < maxB:
		maxB = y
	if y > maxT:
		maxT = y
res = 0.0
if maxR - maxL > res:
	res = maxR - maxL
if maxT - maxB > res:
	res = maxT - maxB
if (maxL ** 2 + maxT ** 2) ** 0.5 > res:
	res = (maxL ** 2 + maxT ** 2) ** 0.5
if (maxT ** 2 + maxR ** 2) ** 0.5 > res:
	res = (maxT ** 2 + maxR ** 2) ** 0.5
if (maxR ** 2 + maxB ** 2) ** 0.5 > res:
	res = (maxR ** 2 + maxB ** 2) ** 0.5
if (maxB ** 2 + maxL ** 2) ** 0.5 > res:
	res = (maxB ** 2 + maxL ** 2) ** 0.5
res = round(res, 24)
print(res)


import math

def distance(x, y):
	return math.sqrt(x * x + y * y)
n = int(input())
x = list()
y = list()
for i in range(n):
	pt = input().split()
	x.append(int(pt[0]))
	y.append(int(pt[1]))
rng_x = max(x) - min(x)
rng_y = max(y) - min(y)
max_hyp = distance(max((abs(i) for i in x)), max((abs(j) for j in y)))
print(max([rng_x, rng_y, max_hyp]))


n = int(input())
x0 = []
y0 = []
for __ in range(n):
	inp = [float(i) for i in input().strip().split(' ')]
	if inp[0] == 0.0:
		x0.append(inp[1])
	else:
		y0.append(inp[0])
x0.sort()
y0.sort()
ans = max(abs(x0[-1] - x0[0]), abs(y0[-1] - y0[0]), (x0[0] ** 2 + y0[0] ** 2) ** 0.5, (x0[0] ** 2 + y0[-1] ** 2) ** 0.5, (x0[-1] ** 2 + y0[0] ** 2) ** 0.5, (x0[-1] ** 2 + y0[-1] ** 2) ** 0.5)
print(ans)


from math import sqrt
xpos = 0
xneg = 0
ypos = 0
yneg = 0
x = int(input())
a = []
for c in range(0, x):
	g = input()
	g = str(g)
	h = []
	commaadded = False
	j = 0
	while commaadded == False:
		j = j + 1
		if g[j] == ' ':
			h.append(g[:j])
			h.append(g[j:])
			commaadded = True
		else:
			pass
	d = int(h[0])
	e = int(h[1])
	if d == 0:
		if e >= 0:
			if e > ypos:
				ypos = e
			else:
				pass
		elif e < yneg:
			yneg = e
		else:
			pass
	elif d >= 0:
		if d > xpos:
			xpos = d
		else:
			pass
	elif d < xneg:
		xneg = d
	else:
		pass
if xpos > -1 * xneg:
	highx = xpos
else:
	highx = -1 * xneg
if ypos > -1 * yneg:
	highy = ypos
else:
	highy = -1 * yneg
f = []
f.append(ypos - yneg)
f.append(xpos - xneg)
f.append(sqrt(highx ** 2 + highy ** 2))
answer = 0
for i in range(0, 3):
	if f[i] > answer:
		answer = f[i]
	else:
		pass
print(answer)


(left, right, up, down) = ([0, 0], [0, 0], [0, 0], [0, 0])
for _ in range(int(input())):
	(x, y) = [int(i) for i in input().split(' ')]
	(x, y) = [int(x), int(y)]
	if x < 0:
		if x < left[0]:
			left = [x, 0]
	elif x > 0:
		if x > right[0]:
			right = [x, 0]
	elif y < 0:
		if y < down[1]:
			down = [0, y]
	elif y > 0:
		if y > up[1]:
			up = [0, y]
dots = [left, right, up, down]
dist = 0
for i in range(len(dots) - 1):
	for j in range(i + 1, len(dots)):
		d = ((dots[i][0] - dots[j][0]) ** 2 + (dots[i][1] - dots[j][1]) ** 2) ** 0.5
		if d > dist:
			dist = d
print('{0:.6f}'.format(dist))


from math import sqrt
N = int(input())
top = 0
bottom = 0
left = 0
right = 0
for _ in range(N):
	(a, b) = [int(_) for _ in input().strip().split(' ')]
	if a == 0:
		if b > 0:
			if b > top:
				top = b
		elif b < bottom:
			bottom = b
	elif a > 0:
		if a > right:
			right = a
	elif a < left:
		left = a
maxVertical = top - bottom
maxHorizontal = right - left
maxDiagonal = sqrt(max(right, -left) ** 2 + max(top, -bottom) ** 2)
print(max(maxVertical, maxHorizontal, maxDiagonal))


checkCoords = [[0, 0], [0, 0], [0, 0], [0, 0]]
for i in range(int(input())):
	currCoords = [int(x) for x in input().split(' ')]
	checkCoords[0][0] = min(checkCoords[0][0], currCoords[0])
	checkCoords[1][1] = min(checkCoords[1][1], currCoords[1])
	checkCoords[2][0] = max(checkCoords[2][0], currCoords[0])
	checkCoords[3][1] = max(checkCoords[3][1], currCoords[1])
maxim = 0
for a in range(len(checkCoords) - 1):
	for b in range(a, len(checkCoords)):
		val = pow(checkCoords[a][0] - checkCoords[b][0], 2) + pow(checkCoords[a][1] - checkCoords[b][1], 2)
		if val > maxim:
			maxim = val
print(pow(maxim, 0.5))


import math
n = int(input())
x0 = 0.0
xf = 0.0
y0 = 0.0
yf = 0.0
for i in range(n):
	(x, y) = [float(x) for x in input().strip().split(' ')]
	x0 = x if x < x0 else x0
	xf = x if x > xf else xf
	y0 = y if y < y0 else y0
	yf = y if y > yf else yf
d12 = math.sqrt(x0 * x0 + yf * yf)
d13 = abs(xf - x0)
d14 = math.sqrt(x0 * x0 + y0 * y0)
d23 = math.sqrt(yf * yf + xf * xf)
d24 = abs(yf - y0)
d34 = math.sqrt(xf * xf + y0 * y0)
solution = max(d12, d13, d14, d23, d24, d34)
print('{0:0.12f}'.format(solution))


import math
n = int(input())
x = 0
x1 = 0
y = 0
y1 = 0
while n:
	(a, b) = [int(i) for i in input().split()]
	if a > 0:
		x = max(a, x)
	elif a < 0:
		x1 = min(a, x1)
	elif b > 0:
		y = max(y, b)
	else:
		y1 = min(y1, b)
	n -= 1
print('{0:.12f}'.format(max(abs(x - x1), abs(y - y1), math.sqrt(x * x + y * y), math.sqrt(x1 * x1 + y * y), math.sqrt(x1 * x1 + y1 * y1), math.sqrt(x * x + y1 * y1))))


left = right = up = down = None
for line in range(int(input())):
	(x, y) = map(int, input().split())
	if not y:
		if left is None or x < left:
			left = x
		if right is None or x > right:
			right = x
	if not x:
		if up is None or y > up:
			up = y
		if down is None or y < down:
			down = y
extremes = set()
if left is not None:
	extremes.add(left)
if right is not None:
	extremes.add(right)
if up is not None:
	extremes.add(up * 1j)
if down is not None:
	extremes.add(down * 1j)
print(max((abs(a - b) for a in extremes for b in extremes)))


from math import sqrt
n = int(input())
r = []
x = set()
y = set()
for i in range(0, n):
	t = input().split()
	if t[0] == '0':
		y.add(int(t[1]))
	else:
		x.add(int(t[0]))
xmin = min(x)
xmax = max(x)
ymin = min(y)
ymax = max(y)
xdist = abs(xmin - xmax)
ydist = abs(ymin - ymax)
d1 = sqrt(xmax ** 2 + ymax ** 2)
d2 = sqrt(xmin ** 2 + ymax ** 2)
d3 = sqrt(xmax ** 2 + ymin ** 2)
d4 = sqrt(xmin ** 2 + ymin ** 2)
print('%0.24f' % max(xdist, ydist, d1, d2, d3, d4))


(xf, x1, x2, yf, y1, y2) = (False, 0, 0, False, 0, 0)
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if x == 0:
		yf = True
		(y1, y2) = (min(y1, y), max(y2, y))
	if y == 0:
		xf = True
		(x1, x2) = (min(x1, x), max(x2, x))
v = max(x2 - x1, y2 - y1)
if xf and yf:
	v = max(v, (max(abs(x1), abs(x2)) ** 2 + max(abs(y1), abs(y2)) ** 2) ** 0.5)
print(v)


import math
b = int(input())
maxn = maxk = absn = absk = minn = mink = float(0)
for x in range(b):
	(n, k) = map(float, input().strip().split(' '))
	if n >= maxn:
		maxn = n
	if k >= maxk:
		maxk = k
	if abs(n) >= absn:
		absn = abs(n)
	if abs(k) >= absk:
		absk = abs(k)
	if n <= minn:
		minn = n
	if k <= mink:
		mink = k
print('%.10f' % max(maxn - minn, maxk - mink, math.sqrt(absn ** 2 + absk ** 2)))


from math import sqrt
Points = int(input().strip())
xp = 0
xm = 0
yp = 0
ym = 0
for point in range(Points):
	(x, y) = [int(p) for p in input().split()]
	if x > xp:
		xp = x
	if x < xm:
		xm = x
	if y > yp:
		yp = y
	if y < ym:
		ym = y
biggest = sqrt((yp - ym) ** 2)
L = [sqrt((0 - xp) ** 2 + (yp - 0) ** 2), sqrt((0 - 0) ** 2 + (yp - ym) ** 2), sqrt((0 - xm) ** 2 + (yp - 0) ** 2), sqrt((xm - xp) ** 2 + (0 - 0) ** 2), sqrt((xm - 0) ** 2 + (0 - ym) ** 2), sqrt((0 - xp) ** 2 + (ym - 0) ** 2)]
L.sort()
print('%.6f' % L[-1])


import math
x_max = x_min = y_max = y_min = 0
n = int(input())
for i in range(n):
	l = input().split(' ')
	l = [int(k) for k in l]
	if l[0] < x_min:
		x_min = l[0]
	if l[0] > x_max:
		x_max = l[0]
	if l[1] < y_min:
		y_min = l[1]
	if l[1] > y_max:
		y_max = l[1]
longest = x_max - x_min
if y_max - y_min > longest:
	longest = y_max - y_min
one = math.sqrt(x_max * x_max + y_max * y_max)
two = math.sqrt(x_max * x_max + y_min * y_min)
three = math.sqrt(x_min * x_min + y_max * y_max)
four = math.sqrt(x_min * x_min + y_min * y_min)
longest = max(longest, max(max(one, two), max(three, four)))
print(longest)


from itertools import combinations
from math import sqrt

def distance(p1, p2):
	return sqrt((p2[0] - p1[0]) ** 2 + (p2[1] - p1[1]) ** 2)
n = int(input())
xs = []
ys = []
for i in range(n):
	(x, y) = input().split()
	x = float(x)
	y = float(y)
	(xs.append(x), ys.append(y))
max_x = max(xs)
max_y = max(ys)
min_x = min(xs)
min_y = min(ys)
points = ((max_x, 0), (0, max_y), (min_x, 0), (0, min_y))
point_combos = combinations(points, 2)
distances = (distance(*i) for i in point_combos)
print(max(distances))


import math
n = int(input())
min_x = 1000000001
max_x = -1000000001
min_y = 1000000001
max_y = -1000000001
for i in range(n):
	(x, y) = [int(a) for a in input().split(' ')]
	if y == 0:
		min_x = min(x, min_x)
		max_x = max(x, max_x)
	if x == 0:
		min_y = min(y, min_y)
		max_y = max(y, max_y)
m1 = max(abs(max_x - min_x), abs(max_y - min_y))
m2 = math.sqrt(max(abs(min_x), abs(max_x)) ** 2 + max(abs(min_y), abs(max_y)) ** 2)
m = max(m1, m2)
print('{0:.6f}'.format(m))


import math, itertools
N = int(input())
distances = {'pos_x': 0, 'neg_x': 0, 'pos_y': 0, 'neg_y': 0}
for i in range(N):
	(x, y) = input().split()
	if x == '0':
		i_y = int(y)
		if i_y >= 0:
			if abs(i_y) > distances['pos_y']:
				distances['pos_y'] = abs(i_y)
		if i_y < 0:
			if abs(i_y) > distances['neg_y']:
				distances['neg_y'] = abs(i_y)
	if y == '0':
		i_x = int(x)
		if i_x >= 0:
			if abs(i_x) > distances['pos_x']:
				distances['pos_x'] = abs(int(x))
		if i_x < 0:
			if abs(i_x) > distances['neg_x']:
				distances['neg_x'] = abs(int(x))
x_dist = distances['pos_x'] + distances['neg_x']
y_dist = distances['pos_y'] + distances['neg_y']
x1_dist = math.sqrt(distances['pos_x'] ** 2 + distances['pos_y'] ** 2)
y1_dist = math.sqrt(distances['pos_y'] ** 2 + distances['neg_x'] ** 2)
x2_dist = math.sqrt(distances['neg_x'] ** 2 + distances['neg_y'] ** 2)
y2_dist = math.sqrt(distances['neg_y'] ** 2 + distances['pos_x'] ** 2)
print('%.6f' % max(x_dist, y_dist, x1_dist, y1_dist, x2_dist, y2_dist))


minX = float('inf')
maxX = -float('inf')
minY = float('inf')
maxY = -float('inf')
for _ in range(int(input())):
	(x, y) = map(float, input().strip().split(' '))
	if x < minX:
		minX = x
	if x > maxX:
		maxX = x
	if y < minY:
		minY = y
	if y > maxY:
		maxY = y
res = max(abs(minX - maxX), abs(minY - maxY), (abs(minX) ** 2 + abs(maxY) ** 2) ** (1 / 2), (abs(minX) ** 2 + abs(minY) ** 2) ** (1 / 2), (maxX ** 2 + maxY ** 2) ** (1 / 2), (abs(maxX) ** 2 + abs(minY) ** 2) ** (1 / 2))
print(round(res, 12))


import math
import sys
points = []
n = int(input().strip())
for i in range(0, n):
	points.append([int(item) for item in input().strip().split(' ')])
minx = points[0][0]
maxx = points[0][0]
miny = points[0][1]
maxy = points[0][1]
for i in range(1, n):
	if points[i][0] < minx:
		minx = points[i][0]
	if points[i][0] > maxx:
		maxx = points[i][0]
	if points[i][1] < miny:
		miny = points[i][1]
	if points[i][1] > maxy:
		maxy = points[i][1]
maximum = 0
points = [(minx, 0), (maxx, 0), (0, miny), (0, maxy)]
for i in range(0, len(points) - 1):
	for j in range(i + 1, len(points)):
		span = abs(points[i][0] - points[j][0]) ** 2 + abs(points[i][1] - points[j][1]) ** 2
		if span > maximum:
			maximum = span
print(math.sqrt(maximum))


import math
n = int(input())
maxX = -10 ** 10
minX = 10 ** 10
maxY = -10 ** 10
minY = 10 ** 10
xs = False
ys = False
for x in range(n):
	str = input()
	x = int(str[0:str.index(' ')])
	y = int(str[str.index(' ') + 1:])
	if x == 0:
		maxY = max(y, maxY)
		minY = min(y, minY)
		xs = True
	if y == 0:
		maxX = max(x, maxX)
		minX = min(x, minX)
		ys = True
distx = 0
disty = 0
if xs:
	distx = maxX - minX
if ys:
	disty = maxY - minY
dist = 0
if xs and ys:
	maxX1 = max(abs(maxX), abs(minX))
	maxY1 = max(abs(maxY), abs(minY))
	dist = math.sqrt(maxX1 ** 2 + maxY1 ** 2)
print(max(max(distx, disty), dist))


from math import hypot
dotList = [tuple(map(int, input().split())) for x in range(int(input()))]
greatestX = leastX = greatestY = leastY = dotList[0]
for dot in dotList:
	x = dot[0]
	y = dot[1]
	if y == 0:
		if x < leastX[0]:
			leastX = (x, 0)
		if x > greatestX[0]:
			greatestX = (x, 0)
	if x == 0:
		if y < leastY[1]:
			leastY = (0, y)
		if y > greatestY[1]:
			greatestY = (0, y)
greatestDistance = 0
extremeDotList = [greatestX, leastX, greatestY, leastY]
for dot in range(4):
	for comparison in range(dot, 4):
		x2 = extremeDotList[comparison][0]
		x1 = extremeDotList[dot][0]
		y2 = extremeDotList[comparison][1]
		y1 = extremeDotList[dot][1]
		distance = hypot(x2 - x1, y2 - y1)
		if distance > greatestDistance:
			greatestDistance = distance
print(greatestDistance)


from decimal import Decimal, getcontext
getcontext().prec = 50
UPPER = 10 ** 9
LOWER = -10 ** 9
N = int(input())
assert 2 <= N and N <= 10 ** 6

def test():
	pass

def get_dist(x_1, y_1, x_2, y_2):
	dx = x_1 - x_2
	dy = y_1 - y_2
	return Decimal(dx * dx + dy * dy).sqrt()
min_x = 0
min_y = 0
max_x = 0
max_y = 0
for _ in range(N):
	(x, y) = map(int, input().strip().split())
	assert LOWER <= x and x <= UPPER
	assert LOWER <= y and y <= UPPER
	if x < min_x:
		min_x = x
	if x > max_x:
		max_x = x
	if y < min_y:
		min_y = y
	if y > max_y:
		max_y = y
print(max(get_dist(max_x, 0, 0, max_y), get_dist(max_x, 0, min_x, 0), get_dist(max_x, 0, 0, min_y), get_dist(0, max_y, min_x, 0), get_dist(0, max_y, 0, min_y), get_dist(min_x, 0, 0, min_y)))


N = int(input())
minX = 10000000000
maxX = -10000000000
minY = 10000000000
maxY = -10000000000
for i in range(N):
	line = [int(x) for x in input().split()]
	(x, y) = (line[0], line[1])
	if x == 0:
		if minY > y:
			minY = y
		if maxY < y:
			maxY = y
	if y == 0:
		if minX > x:
			minX = x
		if maxX < x:
			maxX = x
distances = [maxX - minX, maxY - minY, (maxY ** 2 + minX ** 2) ** 0.5, (maxY ** 2 + maxX ** 2) ** 0.5, (minX ** 2 + minY ** 2) ** 0.5, (minY ** 2 + maxX ** 2) ** 0.5]
print('{:.6f}'.format(max(distances)))


from math import sqrt

def dist(x, y):
	return sqrt(x ** 2 + y ** 2)
c = 10000000000.0
(mnx, mny, mxx, mxy) = (c, c, -c, -c)
for _ in range(int(input())):
	(x, y) = map(float, input().split())
	if x == 0:
		mny = min(mny, y)
		mxy = max(mxy, y)
	else:
		mnx = min(mnx, x)
		mxx = max(mxx, x)
print('%.12f\n' % max(mxy - mny, mxx - mnx, dist(mnx, mny), dist(mnx, mxy), dist(mxx, mny), dist(mxx, mxy)))


def get_distance(x, y):
	return (x * x + y * y) ** 0.5
n = int(input().strip())
xl = []
yl = []
for i in range(n):
	line = input().strip()
	(x, y) = line.split()
	if x != '0':
		xl.append(int(x))
	elif y != '0':
		yl.append(int(y))
(max_x, min_x) = (max(xl), min(xl))
(max_y, min_y) = (max(yl), min(yl))
distances = [max_x - min_x, max_y - min_y, get_distance(max_x, max_y), get_distance(max_x, min_y), get_distance(min_x, max_y), get_distance(min_x, min_y)]
max_dist = max(distances)
print('{0:.6f}'.format(max_dist))


import math
dots = []
x = []
y = []
distance = 0

def dist(x, y):
	return math.sqrt(x ** 2 + y ** 2)
for T in range(int(input())):
	dots.append([int(a) for a in input().split(' ')])
for dot in dots:
	if dot[0] == 0:
		y.append(dot[1])
	if dot[1] == 0:
		x.append(dot[0])
x.sort()
y.sort()
if x[-1] - x[0] < y[-1] - y[0]:
	distance = y[-1] - y[0]
else:
	distance = x[-1] - x[0]
if abs(x[0]) < x[-1]:
	x[0] = x[-1]
if abs(y[0]) < y[-1]:
	y[0] = y[-1]
if dist(x[0], y[0]) > distance:
	distance = dist(x[0], y[0])
print(distance)


import math

def dist(x1, y1, x2, y2):
	return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

def furthest(maxX, maxY, minX, minY):
	return max([maxX - minX, maxY - minY, dist(maxX, 0, 0, maxY), dist(maxX, 0, 0, minY), dist(minX, 0, 0, minY), dist(minX, 0, 0, maxY)])

def findPts():
	(maxX, maxY) = (0, 0)
	(minX, minY) = (0, 0)
	pts = []
	for z in range(t):
		[x, y] = [float(z) for z in input().strip().split()]
		if x == 0:
			maxY = max([y, maxY])
			minY = min([y, minY])
		else:
			maxX = max([x, maxX])
			minX = min([x, minX])
	return furthest(maxX, maxY, minX, minY)
t = int(input())
print('{0:.12f}'.format(findPts()))


n = int(input())
(xs, xl, ys, yl) = (None, None, None, None)
for i in range(n):
	ls = input().split()
	(x, y) = (int(ls[0]), int(ls[1]))
	if x:
		if xs == None or x < xs:
			xs = x
		if xl == None or x > xl:
			xl = x
	if y:
		if ys == None or y < ys:
			ys = y
		if yl == None or y > yl:
			yl = y
ds = []
if xs and xl:
	ds.append(xl - xs)
if ys and yl:
	ds.append(yl - ys)
(cxs, cys) = ([xs, xl], [ys, yl])
for a in cxs:
	if a:
		for b in cys:
			if b:
				ds.append((a ** 2 + b ** 2) ** 0.5)
print(max(ds))


from copy import copy
n = int(input())
left = 0
right = 0
up = 0
down = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x < left:
		left = copy(x)
	if x > right:
		right = copy(x)
	if y > up:
		up = copy(y)
	if y < down:
		down = copy(y)
hor = max([abs(left), abs(right)])
ver = max([abs(up), abs(down)])
print(max([right - left, up - down, (hor ** 2 + ver ** 2) ** (1 / 2)]))


import math
n = int(input())
maxright = 0
maxleft = 0
maxup = 0
maxdown = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if y == 0:
		if x > 0 and x > maxright:
			maxright = x
		elif x < 0 and x < maxleft:
			maxleft = x
	elif y > 0 and y > maxup:
		maxup = y
	elif y < 0 and y < maxdown:
		maxdown = y
a = [0 for x in range(6)]
a[0] = maxright - maxleft
a[1] = maxup - maxdown
a[2] = math.sqrt(maxup ** 2 + maxright ** 2)
a[3] = math.sqrt(maxup ** 2 + maxleft ** 2)
a[4] = math.sqrt(maxdown ** 2 + maxright ** 2)
a[5] = math.sqrt(maxdown ** 2 + maxleft ** 2)
print('{:.6f}'.format(max(a)))


import math
N = int(input())
max_x = [float('-inf'), 0]
min_x = [float('inf'), 0]
max_y = [0, float('-inf')]
min_y = [0, float('inf')]
for i in range(N):
	point = [int(e) for e in input().split(' ')]
	if point[0] == 0:
		if point[1] < min_y[1]:
			min_y[1] = point[1]
		if point[1] > max_y[1]:
			max_y[1] = point[1]
	else:
		if point[0] < min_x[0]:
			min_x[0] = point[0]
		if point[0] > max_x[0]:
			max_x[0] = point[0]
x_distance = max_x[0] - min_x[0]
y_distance = max_y[1] - min_y[1]
minx_miny_distance = math.sqrt(min_x[0] ** 2 + min_y[1] ** 2)
minx_maxy_distance = math.sqrt(min_x[0] ** 2 + max_y[1] ** 2)
maxx_miny_distance = math.sqrt(max_x[0] ** 2 + min_y[1] ** 2)
maxx_maxy_distance = math.sqrt(max_x[0] ** 2 + max_y[1] ** 2)
max_distance = max(x_distance, y_distance, minx_miny_distance, minx_maxy_distance, maxx_miny_distance, maxx_maxy_distance)
print(max_distance)


import sys
import math
n = int(input())
x = []
y = []
inp = []
for i in range(0, n):
	inp = input().split(' ')
	x.append(int(inp[0]))
	y.append(int(inp[1]))
minx = min(x)
miny = min(y)
maxx = max(x)
maxy = max(y)
a = maxx - minx
b = maxy - miny
c = math.hypot(minx, miny)
d = math.hypot(maxx, maxy)
e = math.hypot(maxx, miny)
f = math.hypot(minx, maxy)
s = [a, b, c, d, e, f]
print(max(s))


n = int(input())
dots = []
for i in range(n):
	dots.append(tuple(map(int, input().split())))

def dist(x, y):
	return ((x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2) ** (1 / 2)
left = (min(map(lambda x: x[0], dots)), 0)
right = (max(map(lambda x: x[0], dots)), 0)
down = (0, min(map(lambda x: x[1], dots)))
top = (0, max(map(lambda x: x[1], dots)))
maxdist = 0
d = [left, right, top, down]
for x in d:
	for y in d:
		if dist(x, y) > maxdist:
			maxdist = dist(x, y)
print('%.6f' % maxdist)


from math import sqrt
dist = lambda x1, y1, x2, y2: sqrt(float((x1 - x2) ** 2) + float((y1 - y2) ** 2))
from itertools import combinations
n = int(input())
arr = []
for i in range(n):
	(x, y) = map(int, input().split())
	arr.append((x, y))
(xt, yr, xb, yl) = (0, 0, 0, 0)
for i in range(n):
	if arr[i][0] == 0:
		if arr[i][1] > 0 and dist(0, arr[i][1], 0, 0) > dist(0, yr, 0, 0):
			yr = arr[i][1]
		elif arr[i][1] < 0 and dist(0, arr[i][1], 0, 0) > dist(0, yl, 0, 0):
			yl = arr[i][1]
	elif arr[i][0] > 0 and dist(arr[i][0], 0, 0, 0) > dist(xt, 0, 0, 0):
		xt = arr[i][0]
	elif arr[i][0] < 0 and dist(0, arr[i][0], 0, 0) > dist(xb, 0, 0, 0):
		xb = arr[i][0]
d = sorted([dist(a, u, b, v) for ((a, u), (b, v)) in combinations([(xb, 0), (xt, 0), (0, yr), (0, yl)], 2)])
print(d[-1])


x = int(input())
count = 1
boxx = []
boxy = []
while count <= x:
	y = input()
	a = int(y.strip().split(' ')[0])
	b = int(y.strip().split(' ')[1])
	boxx.append(a)
	boxy.append(b)
	count += 1
m = sorted(boxx)[0]
n = sorted(boxx)[-1]
o = sorted(boxy)[0]
p = sorted(boxy)[-1]
greatest = max((m - n) ** 2, (o - p) ** 2, m ** 2 + p ** 2, n ** 2 + o ** 2, m ** 2 + o ** 2, n ** 2 + p ** 2)
print(greatest ** 0.5)


import math
import decimal

def getDistant(x, y):
	if x == 0:
		return y
	elif y == 0:
		return x
	else:
		return math.sqrt(x * x + y * y)
N = int(input())
xyPlane = [0, 0, 0, 0]
for i in range(N):
	l = list(map(int, input().split()))
	x = l[0]
	y = l[1]
	if x > 0:
		if x > xyPlane[0]:
			xyPlane[0] = x
	elif x < 0:
		if -1 * x > xyPlane[2]:
			xyPlane[2] = -1 * x
	elif y > 0:
		if y > xyPlane[1]:
			xyPlane[1] = y
	elif y < 0:
		if -1 * y > xyPlane[3]:
			xyPlane[3] = -1 * y
max = xyPlane[0] + xyPlane[2]
if max < xyPlane[1] + xyPlane[3]:
	max = xyPlane[1] + xyPlane[3]
if max < getDistant(xyPlane[0], xyPlane[1]):
	max = getDistant(xyPlane[0], xyPlane[1])
if max < getDistant(xyPlane[1], xyPlane[2]):
	max = getDistant(xyPlane[1], xyPlane[2])
if max < getDistant(xyPlane[2], xyPlane[3]):
	max = getDistant(xyPlane[2], xyPlane[3])
if max < getDistant(xyPlane[3], xyPlane[0]):
	max = getDistant(xyPlane[3], xyPlane[0])
SIXPLACES = decimal.Decimal(10) ** (-6)
print(decimal.Decimal(max).quantize(SIXPLACES))


from math import sqrt, pow

def diagonal(x, y):
	return sqrt(x * x + y * y)
N = int(input().strip())
xs = []
ys = []
for an in range(N):
	(x, y) = input().strip().split(' ')
	(x, y) = (float(x), float(y))
	if x == 0:
		ys.append(y)
	else:
		xs.append(x)
distances = []
if ys:
	min_y = min(ys)
	max_y = max(ys)
	distances.append(max_y - min_y)
if xs:
	min_x = min(xs)
	max_x = max(xs)
	distances.append(max_x - min_x)
if xs and ys:
	distances.append(diagonal(min_x, min_y))
	distances.append(diagonal(min_x, max_y))
	distances.append(diagonal(max_x, min_y))
	distances.append(diagonal(max_x, max_y))
print('{}'.format(float(max(distances))))


N = int(input())
points = []
for i in range(N):
	temp = input().strip().split()
	temp = [int(j) for j in temp]
	points += [(temp[0], temp[1])]
max_x = max_y = min_x = min_y = False
for point in points:
	if not max_x or point[0] > max_x:
		max_x = point[0]
	if not min_x or point[0] < min_x:
		min_x = point[0]
	if not max_y or point[1] > max_y:
		max_y = point[1]
	if not min_y or point[1] < min_y:
		min_y = point[1]
furthest_x = max(max_x, abs(min_x))
furthest_y = max(max_y, abs(min_y))
print(max(max_x - min_x, max_y - min_y, (furthest_x ** 2 + furthest_y ** 2) ** 0.5))


import math
n = int(input())
a = []
b = []
for i in range(0, n):
	(x, y) = map(int, input().split())
	if x == 0:
		b.append(y)
	if y == 0:
		a.append(x)
m1 = abs(max(a) - min(a))
n1 = abs(max(b) - min(b))
maximum = max(m1, n1)
max1 = max(abs(max(a)), abs(min(a)))
max2 = max(abs(max(b)), abs(min(b)))
if maximum < math.sqrt(max1 ** 2 + max2 ** 2):
	maximum = math.sqrt(max1 ** 2 + max2 ** 2)
print('{0:.6f}'.format(maximum))


N = int(input().strip())
minx = None
maxx = None
miny = None
maxy = None
for _ in range(N):
	(x, y) = map(float, input().strip().split())
	if minx is None or x < minx:
		minx = x
	if maxx is None or x > maxx:
		maxx = x
	if miny is None or y < miny:
		miny = y
	if maxy is None or y > maxy:
		maxy = y
dx = abs(maxx - minx)
dy = abs(maxy - miny)
x = maxx if abs(maxx) >= abs(minx) else minx
y = maxy if abs(maxy) >= abs(miny) else miny
dxy = (x ** 2 + y ** 2) ** (1 / 2)
print('{:.12f}'.format(max(dx, dy, dxy)))


(y, x) = ([], [])
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	x.append(a)
	y.append(b)
(ix, xx, iy, xy) = (min(x), max(x), min(y), max(y))
d1 = max((xx ** 2 + xy ** 2) ** 0.5, (xx * 2 + iy ** 2) ** 0.5)
d1 = max(d1, ((xx - ix) ** 2) ** 0.5)
ix = max((ix ** 2 + xy ** 2) ** 0.5, (ix ** 2 + iy ** 2) ** 0.5)
d1 = max(d1, ix)
d1 = max(d1, ((xy - iy) ** 2) ** 0.5)
print(d1)


import math

def compute_dist(x1, y1, x2, y2):
	return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
n = int(input())
x = []
y = []
for i in range(n):
	(xi, yi) = list([float(k) for k in input().split()])
	x.append(xi)
	y.append(yi)
dists = []
dists.append(compute_dist(min(x), 0, max(x), 0))
dists.append(compute_dist(min(x), 0, 0, min(y)))
dists.append(compute_dist(min(x), 0, 0, max(y)))
dists.append(compute_dist(max(x), 0, 0, min(y)))
dists.append(compute_dist(max(x), 0, 0, max(y)))
dists.append(compute_dist(0, min(y), 0, max(y)))
print(max(dists))


import heapq
import math

def solve(points, dist=lambda x, y: math.sqrt(x * x + y * y)):
	(xs, ys) = ([], [])
	for (x, y) in points:
		assert x == 0 or y == 0, 'Expected x=0 or y=0'
		heapq.heappush(xs, x)
		heapq.heappush(ys, y)
	(xmin,) = heapq.nsmallest(1, xs)
	(xmax,) = heapq.nlargest(1, xs)
	(ymin,) = heapq.nsmallest(1, ys)
	(ymax,) = heapq.nlargest(1, ys)
	dx = abs(xmax - xmin)
	dy = abs(ymax - ymin)
	q1 = dist(xmax, ymax)
	q2 = dist(xmin, ymax)
	q3 = dist(xmax, ymin)
	q3 = dist(xmax, ymin)
	q4 = dist(xmin, ymin)
	return max([dx, dy, q1, q2, q3, q4])

def main(n):
	points = (map(int, input().strip().split()) for _ in range(n))
	print('{:f}'.format(solve(points)))
main(int(input()))


n = int(input())
maxx = 0.0
minx = 0.0
maxy = 0.0
miny = 0.0
import sys
for i in range(n):
	(dx, dy) = map(int, sys.stdin.readline().split())
	if dx == 0:
		if dy > maxy:
			maxy = dy
		elif dy < miny:
			miny = dy
	elif dx > maxx:
		maxx = dx
	elif dx < minx:
		minx = dx
d = abs(miny - maxy)
dt = abs(minx - maxx)
if dt > d:
	d = dt
dt = pow(minx * minx + miny * miny, 0.5)
if dt > d:
	d = dt
dt = pow(maxx * maxx + maxy * maxy, 0.5)
if dt > d:
	d = dt
dt = pow(maxx * maxx + miny * miny, 0.5)
if dt > d:
	d = dt
dt = pow(minx * minx + maxy * maxy, 0.5)
if dt > d:
	d = dt
print(d)


entrycount = int(input())
for i in range(entrycount):
	(x, y) = [int(entry) for entry in input().strip().split(' ')]
	if i == 0:
		up = (x, y)
		right = (x, y)
		down = (x, y)
		left = (x, y)
	else:
		if y > up[1]:
			up = (x, y)
		if x > right[0]:
			right = (x, y)
		if y < down[1]:
			down = (x, y)
		if x < left[0]:
			left = (x, y)
maxdistance = 0.0
points = [up, right, down, left]
for i in range(len(points)):
	for q in range(i, len(points)):
		temp_dist = ((points[i][0] - points[q][0]) ** 2 + (points[i][1] - points[q][1]) ** 2) ** 0.5
		if temp_dist > maxdistance:
			maxdistance = temp_dist
print('{}'.format(maxdistance))


from math import *
n = int(input())
mx = 0
mnx = 0
my = 0
mny = 0
max_dist = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x > 0:
		mx = max(mx, x)
	else:
		mnx = min(mnx, x)
	if y > 0:
		my = max(my, y)
	else:
		mny = min(mny, y)
l = []
l.append((mx, 0))
l.append((mnx, 0))
l.append((0, my))
l.append((0, mny))
for i in range(3):
	for j in range(i + 1, 4):
		dist = sqrt((l[i][0] - l[j][0]) ** 2 + (l[i][1] - l[j][1]) ** 2)
		max_dist = max(max_dist, dist)
print(max_dist)


from math import sqrt
from itertools import combinations

def distance(p1, p2):
	return sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2)

def max_distance(points):
	x_points = []
	y_points = []
	for point in points:
		if point[0] == 0:
			y_points.append(point)
		else:
			x_points.append(point)
	x_points.sort(key=lambda x: x[0])
	y_points.sort(key=lambda x: x[1])
	extremal_points = [x_points[0], x_points[len(x_points) - 1], y_points[0], y_points[len(y_points) - 1]]
	point_pairs = list(combinations(extremal_points, 2))
	distances = [distance(a, b) for (a, b) in point_pairs]
	return max(distances)
N = int(input().strip())
points = []
for i in range(N):
	point = tuple([int(a) for a in input().strip().split(' ')])
	points.append(point)
print(max_distance(points))


import sys, math
n = int(input())
x = []
y = []
for case in range(n):
	c = [int(x) for x in input().split()]
	if c[0]:
		x.append(c[0])
	elif c[1]:
		y.append(c[1])
x.sort()
y.sort()
x_diff = x[-1] - x[0]
y_diff = y[-1] - y[0]
xy_diff = math.sqrt(max(abs(x[-1]), abs(x[0])) ** 2 + max(abs(y[0]), abs(y[-1])) ** 2)
print('{:.6f}'.format(float(max(x_diff, y_diff, xy_diff))))


import math
n = 0
outp = 0
count = int(input())
smallx = 1000000001
bigx = -10000000001
bigy = -1000000001
smally = 10000000001
while n < count:
	gin = input().split()
	if int(gin[0]) < smallx:
		smallx = int(gin[0])
	elif int(gin[0]) > bigx:
		bigx = int(gin[0])
	if int(gin[1]) < smally:
		smally = int(gin[1])
	elif int(gin[1]) > bigy:
		bigy = int(gin[1])
	n += 1

def distance(a, b):
	return math.sqrt(a ** 2 + b ** 2)
if abs(smallx) > abs(bigx):
	if abs(smally) > abs(bigy):
		outp = distance(smallx, smally)
	else:
		outp = distance(smallx, bigy)
elif abs(smally) > abs(bigy):
	outp = distance(bigx, smally)
else:
	outp = distance(bigx, bigy)
if bigx - smallx > bigy - smally:
	if bigx - smallx > outp:
		outp = bigx - smallx
elif bigy - smally > outp:
	outp = bigy - smally
print(outp)


import math

class point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

def diff(p, q):
	return math.sqrt((p.x - q.x) ** 2 + (p.y - q.y) ** 2)
n = int(input())
l1 = []
l2 = []
for i in range(0, n):
	(x, y) = map(float, input().split())
	l1.append(x)
	l2.append(y)
p1 = point(max(l1), 0)
p2 = point(min(l1), 0)
p3 = point(0, max(l2))
p4 = point(0, min(l2))
diffs = [diff(p1, p2), diff(p1, p3), diff(p1, p4), diff(p2, p3), diff(p2, p4), diff(p3, p4)]
print('{0:.12f}'.format(max(diffs)))


from math import sqrt

def most_distant(dot_list):
	biggest_abs_x = abs(dot_list[0][0])
	biggest_abs_y = abs(dot_list[0][1])
	smallest_x = dot_list[0][0]
	smallest_y = dot_list[0][1]
	largest_x = smallest_x
	largest_y = smallest_y
	for dot in dot_list[1:]:
		x = dot[0]
		y = dot[1]
		if abs(x) > biggest_abs_x:
			biggest_abs_x = abs(x)
		if abs(y) > biggest_abs_y:
			biggest_abs_y = abs(y)
		if x > largest_x:
			largest_x = x
		if y > largest_y:
			largest_y = y
		if x < smallest_x:
			smallest_x = x
		if y < smallest_y:
			smallest_y = y
	biggest_diagonal = sqrt(biggest_abs_x ** 2 + biggest_abs_y ** 2)
	delta_x = abs(largest_x - smallest_x)
	delta_y = abs(largest_y - smallest_y)
	print(max(biggest_diagonal, delta_x, delta_y))
n = int(input().strip())
dots = []
for a_i in range(n):
	(x, y) = input().strip().split(' ')
	dots.append((int(y), int(x)))
most_distant(dots)