
The first line contains an integer 'T', denoting the number of test cases.
The first line of each test case contains four space-separated integers 'a', 'b', 'c', and 'd', as described in the problem statement.
For each test case, print two space-separated integers 'x' and 'y', where the sum (a/b)+(c/d) = x/y in the simplest form.
Print the output of each test case in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 10 ^ 4
1 <= a,b,c,d <= 10 ^ 9
Time Limit: 1 sec
Where 'T' denotes the number of test cases, 'a', 'b', 'c' and 'd' denote the integers given as input in the problem.
As it is difficult to add fractions with different denominators, we first make them equal and follow the following steps to reach our answer in the simplest form.
Pair Product Div by K
Pair Product Div by K
Merge Two Sorted Arrays Without Extra Space
Merge Two Sorted Arrays Without Extra Space
Co-Prime
First Digit One
Special Digit Numbers