Smeshariki Gathering Time
Time limit2sMemory limit1024 MB
Find the minimum seconds for n people on an integer grid to meet at one lattice point, moving up, down, left, right, or staying put each second.
Statement
A new Smeshariki season has started, and everyone is going on a hike. First, they must meet at one point, and only then set off to explore the world. Losyash, who coordinates the group, knows the coordinates of every participant. Find the minimum number of seconds the Smeshariki need to gather in one place.
Initially, every Smeshariki stands on a point of the integer grid. If a Smeshariki is at , then in one second it can move to , , , or , or stay at .
Input
The first line contains one integer , the number of Smeshariki (). Each of the next lines contains the starting position of one Smeshariki, given by two integers and ().
Output
Print a single number, the minimum number of seconds the Smeshariki need to gather in one point.