from sys import stdin
from math import gcd
def lcm(a, b):
return a * b / gcd(a, b)
T=int(stdin.readline())
for _ in range(T):
l,r=map(int,stdin.readline().split())
if l==1:
print(1,2)
else:
if lcm(l,int(l*(1.5)))<=r:
print(l,int(l*(1.5)))
elif lcm(l,int(l*2))<=r:
print(l,int(l*2))
else:
l+=1
if lcm(l,int(l*(1.5)))<=r:
print(l,int(l*(1.5)))
elif lcm(l,int(l*2))<=r:
print(l,int(l*2))
else:
print(-1,-1)
A - LCM Problem
'알고리즘 > Codeforces' 카테고리의 다른 글
Codeforces Round #662 (Div. 2) ABC (0) | 2020.08.08 |
---|---|
Codeforces Round #660 (Div. 2) AB (0) | 2020.08.06 |
Codeforces Round #658 (Div. 2) AB (0) | 2020.08.06 |
Codeforces Round #661 (Div. 3) ABC (0) | 2020.08.06 |
Codeforces Round #656 (Div. 3) ABC (0) | 2020.08.06 |
댓글