# UUID: 322a4f82-cdd2-4d1f-940c-f022ef1003b7
t = int(input())
eltarol = False
for i in range(t):
eltarol = False
a, b = map(int, input().split())
if a < 33 or a > 53:
print("-1 -1")
else:
a -= 33
if a > 10:
a -= 10
b -= 11
if b >= 0:
eltarol = True
else:
print("-1 -1")
continue
if a > 0:
b -= 11
if b >= 0:
print(f"{a} 11")
else:
print("-1 -1")
continue
if b > 9:
b -= 10
print("11 10")
if b > 9:
b -= 10
print("11 10")
else:
print("11 0")
else:
print("11 0")
print("11 0")
if eltarol:
print("10 11")
print(f"11 {b}")
| Subtask | Sum | Test | Verdict | Time | Memory | ||
|---|---|---|---|---|---|---|---|
| subtask1 | 0/0 | ||||||
| 1 | Accepted | 45ms | 19436 KiB | ||||
| subtask2 | 20/20 | ||||||
| 2 | Accepted | 39ms | 19692 KiB | ||||
| subtask3 | 0/30 | ||||||
| 3 | Wrong answer | 59ms | 21992 KiB | ||||
| subtask4 | 0/50 | ||||||
| 4 | Time limit exceeded | 107ms | 23656 KiB | ||||
| 5 | Time limit exceeded | 119ms | 23864 KiB | ||||
| 6 | Time limit exceeded | 123ms | 23636 KiB | ||||