Bunty and Bublee like to play with numbers. You have to distribute \(n_{1}\) and \(n_{2}\) integers between Bunty and Bublee respectively. You cannot give the same numbers to both Bunty and Bublee. Also, Bunty doesn't like the numbers that are divisible by prime number \(x\) and Bublee doesn't like the numbers that are divisible by a prime number \(y\). So you cannot distribute the numbers to them that they do not like. Find the minimum value of \(n\), that you can use to distribute from set \(1, 2, 3, \dots, n\). You can choose not to distribute some numbers at all.
Input format
- The first line contains an integer \(T\) - denoting the number of test cases.
- The first line of each test case contains \(4\) space-separated integers \(n_{1}, n_{2}, x, y\).
Output format
Print a single integer - the minimum number \(n\), that you can use to distribute numbers from the set \(1, 2, 3, \dots, n\).
Constraints
\(1 \le T \le 100\)
\(1 \leq n_{1} , n_{2} < 10^9\)
\(n_{1} + n_{2} \leq 10^9\)
\(2 \leq x < y \leq 10^5\)