Quadcopter Competition

题意翻译

你参加了一个飞行器比赛,并知道你的飞行器起点在$(x_1,y_1)$ ,有一面旗子在$(x_2,y_2)$ 。 每次你的飞行器能够沿平行于坐标轴方向移动$1$ 单位长度,即假如你在$(x,y)$ ,你的飞行器可以前往$(x+1,y),(x-1,y),(x,y+1),(x,y-1)$ 四者中的一个。 现在你需要规划一个路线,这个路线从起点出发并回到起点,并构成一个封闭环。同时这个封闭环必须**严格包含**旗子所在的格点。(具体看下面的图片) 求飞行器最短飞行距离为多少。 ### 输入格式 第一行$x_1,y_1$ ,第二行$x_2,y_2$ 。 ### 输出格式 一个答案。 ### 数据范围 $-100\le x_1,x_2,y_1,y_2\le 100$ 。 感谢@U50882 OwenOwl 提供的翻译

题目描述

Polycarp takes part in a quadcopter competition. According to the rules a flying robot should: - start the race from some point of a field, - go around the flag, - close cycle returning back to the starting point. Polycarp knows the coordinates of the starting point ( $ x_{1},y_{1} $ ) and the coordinates of the point where the flag is situated ( $ x_{2},y_{2} $ ). Polycarp’s quadcopter can fly only parallel to the sides of the field each tick changing exactly one coordinate by $ 1 $ . It means that in one tick the quadcopter can fly from the point ( $ x,y $ ) to any of four points: ( $ x-1,y $ ), ( $ x+1,y $ ), ( $ x,y-1 $ ) or ( $ x,y+1 $ ). Thus the quadcopter path is a closed cycle starting and finishing in ( $ x_{1},y_{1} $ ) and containing the point ( $ x_{2},y_{2} $ ) strictly inside. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF883M/386c66ca9620cccfa6fb068c3cb9fb65984ca527.png)The picture corresponds to the first example: the starting (and finishing) point is in ( $ 1,5 $ ) and the flag is in ( $ 5,2 $ ).What is the minimal length of the quadcopter path?

输入输出格式

输入格式


The first line contains two integer numbers $ x_{1} $ and $ y_{1} $ ( $ -100<=x_{1},y_{1}<=100 $ ) — coordinates of the quadcopter starting (and finishing) point. The second line contains two integer numbers $ x_{2} $ and $ y_{2} $ ( $ -100<=x_{2},y_{2}<=100 $ ) — coordinates of the flag. It is guaranteed that the quadcopter starting point and the flag do not coincide.

输出格式


Print the length of minimal path of the quadcopter to surround the flag and return back.

输入输出样例

输入样例 #1

1 5
5 2

输出样例 #1

18

输入样例 #2

0 1
0 0

输出样例 #2

8