SOLVE
LATER
You are given a,b and c.You need to convert a to b.
You can perform following operations :-
1) Multiply a by c.
2) Decrease a by 2.
3) Decrease a by 1.
You can perform this operation in any order and any number of times.
You need to find and print minimum number of steps to convert a to b.
Constraints :-
\(1 \leq t \leq 10^{4}\)
\(0 \leq a,b,c \leq 10^{9}\)
Input : -
First line contains nuber of test cases.
Next \(t\) line for contains three space separated integer \(a , b , c . \).
Output : -
Print minimum no. of steps as output in new line for each test case.
For test case \(1\): -
1) First multple \(3\) with \(2\) then
2) Subtract \(1\) from \(6\) to get \(5\)
3) Multiple \(5\) with \(2\) to get \(10\).
So, 3 steps.
For test case \(2\): -
1) Subtact \(2\) from \(11\) , 2 times
2) Subtract \(1\) from 7.
So, 3 steps.