LearnPy Hub
← Arena
AdvancedRating 1600

Farthest Apart (Manhattan)

Print the largest Manhattan distance |x1 − x2| + |y1 − y2| between any two of the points, in O(n).

Input

n, then n lines 'x y'.

Output

A number.

Sample 1

Input
3
1 1
2 2
3 3
Output
4

Sample 2

Input
1
5 5
Output
0
solution.py
Output appears here
Farthest Apart (Manhattan) · Python Arena problem · LearnPy Hub