A logistics planner has n warehouses at integer coordinates. For every unordered pair of warehouses, compute their Manhattan distance |x1 - x2| + |y1 - y2|, and report the sum of these distances over all pairs.
Input format
Line 1: an integer n, the number of warehouses.
Next n lines: two integers x y, the position of a warehouse.
Output format
A single integer: the total of the Manhattan distances over all unordered pairs. If there are fewer than two warehouses the total is 0.
Constraints
- 1 <= n <= 100000
- -1000000 <= x, y <= 1000000