409824: GYM103800 A Ginger's number

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Ginger's numbertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Ginger have two positive integers $$$x, y$$$, you have to do exactly one operation:

Choose two positive integers $$$a, b$$$, change $$$x$$$ to $$$\dfrac{x}{a}$$$, and change $$$y$$$ to $$$\dfrac{y}{b}$$$, ($$$a$$$ must be a divisor of $$$x$$$, $$$b$$$ must be a divisor of $$$y$$$ and $$$\gcd(\dfrac{x}{a}, \dfrac{y}{b}) = 1$$$).

Find the minimum value of $$$a \times b$$$.

Input

The first line of input contains a single integer $$$T$$$ $$$(1 \le T \le 10 ^ 5)$$$ — the number of input test cases.

For each test case, the only line of input contains two positive integers $$$x, y$$$ $$$(1 \le x,y \le 10 ^ 9)$$$.

Output

Print the minimum value of $$$a \times b$$$.

ExampleInput
1
114514 1919810
Output
2

加入题单

上一题 下一题 算法标签: