Given n points with integer coordinates in 3-D cartesian space, find the maxmimum distance between any pair of them.
Note that here "distance" is defined as the manhatton distance, that is, the sum of absolute difference of each x/y/z coordinate between a pair of point.
There are multiple testcase, input is terminated by EOF.
Each testcase starts with an integer N (2<=N<=100000), denoting the number of points in space. The following N lines each contain a triple of integers that represents the (x,y,z) coordinate of a point. 0 <= |xi|, |yi| |zi| <= 107.
For each testcase output a number in a single line indicating the maximum manhatton distance between all possible pairs.
3 1 2 3 0 -3 2 5 4 1
13
Migrated from old NTUJ.
uva11012
No. | Testdata Range | Score |
---|