SPEED  Circular Track
Two persons are running on a circular track either in the same direction or in the opposite direction, indefinitely. The speed of both of them is given to you. Speed will be positive in clockwise direction, and negative in anticlockwise direction. Print the number of distinct points, at which they will meet on the circle.
Input
First line contains T, number of test cases. Each test case contains two integers, S1 and S2 (not equal to zero) which are the speeds of the two persons. S1 and S2 will be distinct.
Edited: All the numbers fit in signed 32bit integer.
Output
Print in a separate line, the number of distinct points at which they meet.
Example
Input 2 1 2 1 1 Output 1 2
hide comments
Akshat Aggarwal:
20110903 13:18:37
whats the constraints on maximum value on S1 and S2 

Shizuo Heiwajima:
20110901 13:16:46
What should be output for :


Gaurav Mittal:
20110822 11:39:45
enough, why am i getting wrong answer


Dravid:
20110818 08:46:52
so simple....:D 

arshak minasyan:
20110807 08:46:08
@Alejandro Flores


Alejandro Flores:
20110731 04:01:18
Hi !


Vimal Raj Sharma:
20110728 07:29:13
awesome problem :) 

nagesh:
20110726 14:22:10
Nice one..:D 

blashyrkh:
20110725 18:56:08
@Hagen von Eitzen: no :) 

Hagen von Eitzen:
20110725 18:01:23
The sample cases seem to imply that the diameter of the track is approximately 0.31830988618379 
Added by:  Nikunj Jain 
Date:  20110721 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 