#5644. All Manhattan Distances
0
All Manhattan Distances
All Manhattan Distances
Given a set of points, calculate the sum of all Manhattan distances between two point pairs.
Input
The first line has an integer n: the number of points. The following n lines describe the points. Each line has two integers x and y. You can assume that each point is distinct.
Output
Print the sum of all Manhattan distances.
Constraints
\cdot 10^5$
Example
Input
5
1 1
3 2
2 4
2 1
4 5
Output
36