Farthest by Manhattan
Print the maximum Manhattan distance |xi−xj| + |yi−yj| over all point pairs.
Input: the first line has N (N ≥ 2); the next N lines each have x y.
Output: the maximum pairwise Manhattan distance.
Constraints:
- 2 ≤ N ≤ 105
- |coordinates| ≤ 106
Sample Tests
Input 1
3 0 0 2 3 -1 1
Output 1
5
Input 2
2 0 0 1 1
Output 2
2
Discussion (opens after you solve — no spoilers before)
No comments yet.