You are given two integers a and b. You can perform a sequence of operations: during the first operation you choose one of these numbers and increase it by 1; during the second operation, you choose one of these numbers and increase it by 2, and so on. You choose the number of these operations yourself.
For example, if a=1 and b=3, you can perform the following sequence of three operations:
- add 1 to a, then a=2 and b=3;
- add 2 to b, then a=2 and b=5;
- add 3 to a, then a=5 and b=5;
Calculate the minimum number of operations required to make a and b equal.
INPUT:
- The only input will be unknown pair of a and b.
- It is guaranteed that at max 100 pairs will be thrown in a test.
CONSTRAINTS:
- 1 ≤ a, b ≤ 109
OUTPUT:
For each test case print one integer — the minimum numbers of operations required to make a and b equal.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor