#P1916B. Two Divisors

    ID: 8942 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>constructive algorithmsmathnumber theory*900

Two Divisors

No submission language available for this problem.

Description

A certain number 1x1091 \le x \le 10^9 is chosen. You are given two integers aa and bb, which are the two largest divisors of the number xx. At the same time, the condition 1a<b<x1 \le a < b < x is satisfied.

For the given numbers aa, bb, you need to find the value of xx.

^{\dagger} The number yy is a divisor of the number xx if there is an integer kk such that x=ykx = y \cdot k.

Each test consists of several test cases. The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases. Then follows the description of the test cases.

The only line of each test cases contains two integers aa, bb (1a<b1091 \le a < b \le 10^9).

It is guaranteed that aa, bb are the two largest divisors for some number 1x1091 \le x \le 10^9.

For each test case, output the number xx, such that aa and bb are the two largest divisors of the number xx.

If there are several answers, print any of them.

Input

Each test consists of several test cases. The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases. Then follows the description of the test cases.

The only line of each test cases contains two integers aa, bb (1a<b1091 \le a < b \le 10^9).

It is guaranteed that aa, bb are the two largest divisors for some number 1x1091 \le x \le 10^9.

Output

For each test case, output the number xx, such that aa and bb are the two largest divisors of the number xx.

If there are several answers, print any of them.

Sample Input 1

8
2 3
1 2
3 11
1 5
5 10
4 6
3 9
250000000 500000000

Sample Output 1

6
4
33
25
20
12
27
1000000000

Note

For the first test case, all divisors less than 66 are equal to [1,2,3][1, 2, 3], among them the two largest will be 22 and 33.

For the third test case, all divisors less than 3333 are equal to [1,3,11][1, 3, 11], among them the two largest will be 33 and 1111.

For the fifth test case, all divisors less than 2020 are equal to [1,2,4,5,10][1, 2, 4, 5, 10], among them the two largest will be 55 and 1010.

For the sixth test case, all divisors less than 1212 are equal to [1,2,3,4,6][1, 2, 3, 4, 6], among them the two largest will be 44 and 66.