You will be given a pair of positive integers (x, y). In one step, you take the greater of the two integers and subtract the smaller one from it. You keep doing this untill one of the integers becomes 0 and then you stop. For example: (5,13) --> (5,8) --> (5,3) --> (2,3) --> (2,1) --> (1,1) --> (1,0). This takes 6 steps in this case. You have to find out the number of steps it takes to reach a situation where one of the integers becomes 0.
The first line of input contains a single integer T denoting the number of test cases. Then T test cases follow. Each test case consists of one line only. The line consists one two space separated positive integers which denote (xi, yi).
Corresponding to each test case, in a new line, print the number of steps.
1 ≤ T ≤ 200
1 ≤ xi, yi ≤ 109
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.