title: Minimum number of steps required to convert A to B
body: <p>I have recently participated in a coding contest where one of the problems was as follows: </p>
  
  <p>Given two integers X and Y, find the minimum number of steps required to convert X to Y. You can perform the following operations any number of times in any order: </p>
  
  <p>1) Divide X by any integer A,     2)Multiply X by any integer B.</p>
  
  <p>Example: If X=15 and Y=10, then first multiply X by 2 which gives 30 and then divide 30 by 3 to get Y(i.e.,10). So the minimum no. of steps in this case is 2.</p>
  
  <p>I have no idea how to solve it.</p>