Broken Calculator
The calculator features two memory cells: the first cell's content is always visible on the screen, while the second cell serves as a buffer. Initially, the screen displays an integer (X), and the buffer holds the number (0). The calculator is equipped with only two buttons: «+» and «=». Pressing «+» copies the number currently shown on the screen into the buffer. Pressing «=» adds the number from the buffer to the number displayed on the screen, updating the screen with the result, while the buffer's content remains unchanged.
Your task is to reach the number (Y) on the screen with the fewest possible button presses.
Input
The input consists of two integers (X) and (Y). Each number does not exceed (10^9) in absolute value.
Output
On the first line of the output, print a single number — the minimum number of button presses required to display the number (Y). If it is impossible to transform the number (X) into (Y) using the given operations, print (-1).