题目描述
Dazzler has a task for you.
Given two positive integers A and B, find two positive integers i and j such that:
gcd > 1;
A ≤ i < j ≤ B;
The value (i + j) is minimum possible.
If there are multiple solutions, you may print any of them. If no such pair exists, print -1.
------ Input Format ------
- First line will contain T, number of test cases. Then the test cases follow.
- Each test case contains of a single line of input, two integers A and B.
------ Output Format ------
For each test case, output in a single line two space-separated integers i and j satisfying all the conditions. If no such pair exists, print -1.
------ Constraints ------
$1 ≤ T ≤ 10^{5}$
$1 ≤ A < B ≤ 10^{9}$
----- Sample Input 1 ------
2
2 3
2 10
----- Sample Output 1 ------
-1
2 4
----- explanation 1 ------
Test case $1$: There exists no pair satisfying all the conditions.
Test case $2$: A valid pair satisfying all the conditions is $(i, j) = (2, 4)$. The value $\texttt{gcd}(2, 4) = 2 >1$. The value $(i+j) = 6$.
It can be proven that no such pair exists that satisfies all the conditions and has sum less than $6$.
输入格式
见题面
输出格式
见题面