The Great Forest of Köres has been set ablaze, leading to one of the greatest forest fires in all of recorded history. The country of Werłantž, which presides over the forest had luckily foreseen the event and built bunkers, where the residents of the Great Forest of Köres may escape to. There are
Constraints
The coordinates of all of the locations are less than or equal to
Subtask 1 [10%]
Subtask 2 [20%]
The coordinates of all locations are less than or equal to
Subtask 3 [70%]
No additional constraints.
Input Specification
The first line contains the integer
The next line contains the integer
Output Specification
Output one integer, the sum of the distances traveled by all of the communities.
Sample Input
3
1 1
2 2
3 1
2
0 0
4 0
Sample Output
8
Comments