Berland 广场AI (CI翻译)
Last year the world's largest square was built in Berland. It is known that the square can be represented as an infinite plane with an introduced Cartesian system of coordinates. On that square two sets of concentric circles were painted. Let's call the set of concentric circles with radii $1, 2, ..., *K*$ and the center in the point $(*z*, 0)$ a $(*K*, *z*)$-set. Thus, on the square were painted a $(*N*, *x*)$-set and a $(*M*, *y*)$-set. You have to find out how many parts those sets divided the square into.
$(*z*, 0)$、半径为 $1, 2, ..., *K*$ 的同心圆集合称为一个 $(*K*, *z*)$-集合。因此,广场上绘制了一个 $(*N*, *x*)$-集合和一个 $(*M*, *y*)$-集合。你需要求出这些集合将广场划分成了多少个部分。AI (CI翻译)Input
输入格式
AI (CI翻译)The first line contains integers $*N*, *x*, *M*, *y*$. ($1 ≤ *N*, *M* ≤ 100000, - 100000 ≤ *x*, *y* ≤ 100000, *x* ≠ *y*$).
第一行包含整数 $*N*, *x*, *M*, *y*$。($1 ≤ *N*, *M* ≤ 100000, - 100000 ≤ *x*, *y* ≤ 100000, *x* ≠ *y*$)。AI (CI翻译)
Output
输出格式
AI (CI翻译)Print the sought number of parts.
输出所求的部分数量。AI (CI翻译)
Note
说明
AI (CI翻译)Picture for the third sample:
第三个样例的图示:AI (CI翻译)

AI (CI翻译)
样例
1 0 1 1
4
1 0 1 2
3
3 3 4 7
17
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。