Converting a to b using three operation

question link->https://www.hackerearth.com/practice/basic-programming/recursion/recursion-and-backtracking/practice-problems/algorithm/question-2-38-cf73c1b4/submissions/

my solution->https://ide.codingblocks.com/s/323284

it is not working properly

can i get correct ans for this question??

Hey
Sorry I missed this .
So in above question
Some points I considered multiplying a by c is equivalent to dividing b by c when b is multiple of c
Also subtracting 1,2 from a is equivale to adding 1,2 to b when a>b

Here is the code if you don’t understand something let me know

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

@Kartikkhariwal1
can you please provide the dynamic pro solution.

Hey @ankit_verma
How is this a DP question? Acc to me this is a greedy question.