#arc159b. [arc159_b]GCD Subtraction
[arc159_b]GCD Subtraction
Problem Statement
We have variables and . Initially, and .
Takahashi will repeat the following operation while both and are greater than or equal to .
- Let be the greatest common divisor of and , and replace and with and , respectively.
How many times will he perform the operation?
Constraints
- and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
15 9
Sample Output 1
2
We start with and perform the following.
- Let , and replace and with and , respectively.
- Let , and replace and with and , respectively. is no longer greater than or equal to , so the iteration terminates.
Sample Input 2
1 1
Sample Output 2
1
Sample Input 3
12345678910 10987654321
Sample Output 3
36135