Codeforces Beta Round 47
C
Happy Farm 5
Codeforces
2000
原题
← BD →
翻译中…

The Happy Farm 5 creators decided to invent the mechanism of cow grazing. The cows in the game are very slow and they move very slowly, it can even be considered that they stand still. However, carnivores should always be chased off them.

翻译中…

For that a young player Vasya decided to make the shepherd run round the cows along one and the same closed path. It is very important that the cows stayed strictly inside the area limited by the path, as otherwise some cows will sooner or later be eaten. To be absolutely sure in the cows' safety, Vasya wants the path completion time to be minimum.

翻译中…

The new game is launched for different devices, including mobile phones. That's why the developers decided to quit using the arithmetics with the floating decimal point and use only the arithmetics of integers. The cows and the shepherd in the game are represented as points on the plane with integer coordinates. The playing time is modeled by the turns. During every turn the shepherd can either stay where he stands or step in one of eight directions: horizontally, vertically, or diagonally. As the coordinates should always remain integer, then the length of a horizontal and vertical step is equal to $1$, and the length of a diagonal step is equal to image. The cows do not move. You have to minimize the number of moves the shepherd needs to run round the whole herd.

翻译中…

Input

翻译中…

The first line contains an integer $*N*$ which represents the number of cows in the herd ($1 ≤ *N* ≤ 10^{5}$). Each of the next $*N*$ lines contains two integers $*X*_{*i*}$ and $*Y*_{*i*}$ which represent the coordinates of one cow of ($|*X*_{*i*}|, |*Y*_{*i*}| ≤ 10^{6}$). Several cows can stand on one point.

翻译中…

Output

翻译中…

Print the single number — the minimum number of moves in the sought path.

翻译中…

Note

翻译中…

Picture for the example test: The coordinate grid is painted grey, the coordinates axes are painted black, the cows are painted red and the sought route is painted green.

翻译中…

image

翻译中…

样例

Input #1
4
1 1
5 1
5 3
1 3
Output #1
16
InputCopy OutputCopy
题目信息
题号
50C
时间限制
2 s
内存限制
256 MB
标签
计算几何

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。