Problem Statement:

In your neighborhood, a morning ritual is having two groups of kids fighting over the playground. Those groups would like to have a soccer game but most of the times the groups have different number of kids, at this point the kids agreed that each group should form some number of teams, all teams should be the same size. Then a match will be held between every team from the first group with every other team in the second group. All groups of kids want to play, so any kid should belong to one and only one team. Kids would like to have the minimum possible number of matches. One day the yelling and noise become unbearable so you've decided to solve this issue once and forever.

Input Format:

The first line contains one integer 0 < t ≤ 100 which is the number of test cases. Each test case is a line containing two integers (0 < A, B < 216) separated by a space. A and B are the number of kids in the first group and the second group consecutively.

Output Format:

For each test case you should output one line containing two values separated by a space, the first is the size of each team, the second is the minimum possible number of matches consecutively.

Sample Input:

4
5 8
7 7
12 6
4 6

Sample Output:

1 40
7 1
6 2
2 6