Problem4518--国王距离

4518: 国王距离

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

在一个棋盘上,有两颗棋子,称之为国王。

一个国王在第 lns="http://www.w3.org/1998/Math/MathML">a 行第 lns="http://www.w3.org/1998/Math/MathML">b 列,另一个国王在第 lns="http://www.w3.org/1998/Math/MathML">x 行第 lns="http://www.w3.org/1998/Math/MathML">y 列。

国王行棋时,可以选择沿行方向移动一个单位,或沿列方向移动一个单位,或同时沿行方向列方向各移动一个单位。这称之为国王移动了一步棋。

请问至少需要移动多少步才能让两个国王相遇在同一个位置上?

Input

  • 第一行:两个整数 lns="http://www.w3.org/1998/Math/MathML">a 与 lns="http://www.w3.org/1998/Math/MathML">b
  • 第二行:两个整数 lns="http://www.w3.org/1998/Math/MathML">x 与 lns="http://www.w3.org/1998/Math/MathML">y
  • lns="http://www.w3.org/1998/Math/MathML">1x,y1000



Output

  • 单个整数:表示答案

Sample Input Copy

1 1
2 2

Sample Output Copy

1

Source/Category