eolymp
bolt
Try our new interface for solving problems
Problems

On a hike!

On a hike!

A new season in the country of Smeshariki! Now they are all going on a hike. To do this, they need to meet at one point, and from there go to conquer the world. Losyash, who coordinates the actions of Smeshariki, knows the coordinates of all participants in the campaign. Help him determine the minimum number of seconds Smeshariki will need to get together. Initially, all Smeshariki are located in the nodes of the integer grid. If Smesharik is at the point $(x, y)$, then in one second he can move to the points $(x, y + 1)$, $(x + 1, y)$, $(x - 1, y)$ or $(x, y - 1)$, or stay at the point $(x, y)$. \InputFile The first line contains one integer $n~(1 \le n \le 200000)$ --- the number of Smeshariki. Further in $n$ lines the initial positions of Smeshariki are given. Each position is described by two integers $x_i$ and $y_i~(-10^{18} \le x_i, y_i \le 10^{18})$. \OutputFile Print a single number --- the minimum number of seconds that Smeshariki will need to gather at one point.
Time limit 1 second
Memory limit 128 MiB
Input example #1
1
1 1
Output example #1
0
Input example #2
2
1 3
4 4
Output example #2
2
Input example #3
3
0 0
3 3
0 3
Output example #3
3
Source 2020 Cycle of Internet Olympiads for schoolchildren, First team contest, October 18, Problem C