| Codeforces Round 1103 (Div. 3) |
|---|
| Finished |
An annual programmers fair is taking place on the main square of Omsk. You, as the main programmer of Omsk, decided to take part in this wonderful event and went there. At the entrance, a guard decided to check your skills and gave you a problem:
You are given three integers $$$a$$$, $$$b$$$, $$$x$$$. You want to make $$$a$$$ and $$$b$$$ equal. In order to do so, you can apply the following operations:
You need to find the minimum number of operations after which $$$a$$$ becomes equal to $$$b$$$. Can you prove your skills, or will you have to go back home?
The first line contains a single integer $$$t$$$ $$$(1 \le t \le 10^4)$$$ — the number of test cases.
Then $$$t$$$ test cases follow.
Each test case consists of a single line containing three integers $$$a$$$, $$$b$$$, $$$x$$$ ($$$1 \le a, b \le 10^9$$$, $$$2 \le x \le 10^9$$$).
For each test case, output a single integer — the minimum number of operations required to make $$$a$$$ and $$$b$$$ equal.
71 2 32 3 27 3 1017 3 310 10 24 7 21 6 2
1123022
| Name |
|---|


