# UUID: 6288a96c-41bd-441e-8a62-5cdf29deba5c
t = int(input())
eltarol = False
for i in range(t):
eltarol = False
a, b = map(int, input().split())
if a < 33 or a > 53 or (a==b and a==33) or (a==b and 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")
if b > 10:
b -= 11
print("0 11")
print(f"11 {b}")
| Subtask | Sum | Test | Verdict | Time | Memory | ||
|---|---|---|---|---|---|---|---|
| subtask1 | 0/0 | ||||||
| 1 | Accepted | 45ms | 19692 KiB | ||||
| subtask2 | 20/20 | ||||||
| 2 | Accepted | 46ms | 19688 KiB | ||||
| subtask3 | 0/30 | ||||||
| 3 | Wrong answer | 67ms | 21980 KiB | ||||
| subtask4 | 0/50 | ||||||
| 4 | Time limit exceeded | 115ms | 23616 KiB | ||||
| 5 | Time limit exceeded | 103ms | 23420 KiB | ||||
| 6 | Time limit exceeded | 120ms | 24208 KiB | ||||