Alyona always plays with the numbers and the numbers that are between two numbers. Alyona's teacher notices this and gives her a mini assessment.
The teacher gives her three numbers $$$n$$$, $$$l$$$, and $$$r$$$ ($$$l \le r$$$). Alyona has to find the minimum integer $$$x$$$ such that:
Here $$$\operatorname{gcd}$$$ denotes the greatest common divisor.
If there is no such integer $$$x$$$, output $$$-1$$$ instead.
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^3$$$).
The only line of each test case contains three integers $$$n$$$, $$$l$$$, and $$$r$$$ ($$$1 \le n \le 10^9$$$, $$$1 \le l \le r \le 10^9$$$).
For each test case, output an integer — the minimum integer $$$x$$$ satisfying the conditions above. If there is no such integer $$$x$$$, output $$$-1$$$ instead.
36 5 710 1 102 3 4
6 1 -1
In the first test case, the smallest integer in the range $$$[5, 7]$$$ is $$$5$$$. However, $$$\gcd(6, 5) = 1$$$, which is not in $$$[5, 7]$$$. Next, for $$$x = 6$$$, $$$\gcd(6, 6) = 6$$$, which is in $$$[5, 7]$$$. Therefore, the answer is $$$6$$$.