P9581 "MXOI Round 1" Treasure Chests

Description

Little C likes collecting treasure chests in a game called Yuanshen (pinyin). Now, Little C is on a number line, and he is at the origin of the number line. At the same time, there are two treasure chests on this number line, with coordinates $a$ and $b$. As long as Little C moves to the position of a treasure chest, we consider that Little C has collected this treasure chest. In particular, if Little C is initially at the position of a treasure chest, then he can collect this treasure chest directly. If the two treasure chests are at the same position, then he can collect both treasure chests at the same time. Each time, Little C can move 1 unit length along the positive direction or the negative direction of the number line. Little C wants to know: to collect both treasure chests, what is the minimum number of moves needed?

Input Format

Two integers $a,b$.

Output Format

One integer, representing the minimum number of moves Little C needs to collect both treasure chests.

Explanation/Hint

#### Sample Explanation #1. Little C can first move $1$ time in the negative direction of the number line, and then move $2$ times in the positive direction. It can be proven that Little C needs at least $3$ moves. #### Sample Explanation #2. Little C can directly move $5$ times in the negative direction of the number line. It can be proven that Little C needs at least $5$ moves. #### Constraints. For $100\%$ of the testdata, $\vert a\vert,\vert b\vert \le 200$. | Test Point ID | Special Property | | :---: | :---: | | $1\sim3$ | Guaranteed that $\vert a\vert,\vert b\vert \le 1$ | | $4\sim6$ | Guaranteed that $ab=0$ | | $7\sim10$ | None | Translated by ChatGPT 5