Bunty and Bublee like to play with numbers. You have to distribute n1 and n2 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,…,n. You can choose not to distribute some numbers at all.
Input format
Output format
Print a single integer - the minimum number n, that you can use to distribute numbers from the set 1,2,3,…,n.
Constraints
1≤T≤100
1≤n1,n2<109
n1+n2≤109
2≤x<y≤105
In the first sample, you give the set of numbers {1, 3, 5} to Bunty and the set of numbers {2} to Bublee.