N = int(input())
P = [11,11,11]
O = []
for i in range (N):
A, B = [int(i) for i in input().split()]
if A > 43:
P[-1] = 10
P += [A%43,11]
T = B - 22
for i in range(2):
if T > 9:
O.append(10)
T = T - 10
elif B == 0:
O.append(0)
else:
O.append(T)
T = 0
for i in range(2):
O.append(11)
if T > 9:
O.append(10)
T = T - 10
elif B == 0:
O.append(0)
else:
O.append(T)
T = 0
elif 44 > A > 33:
P[-1] = A%33
P.append(11)
T = B - 11
for i in range(2):
if T > 9:
O.append(10)
T = T - 10
elif B == 0:
O.append(0)
else:
O.append(T)
T = 0
O.append(11)
if T > 9:
O.append(10)
T = T - 10
elif B == 0:
O.append(0)
else:
O.append(T)
T = 0
else:
T = B
for i in range(3):
if T > 9:
O.append(10)
T = T - 10
elif B == 0:
O.append(0)
else:
O.append(T)
T = 0
if 33 > A or A > 53:
P = [-1]
O = [-1]
for i in range(len(P)):
print(P[i], O[i])
O = []
P = [11,11,11]
Részfeladat | Összpont | Teszt | Verdikt | Idő | Memória | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Elfogadva | 17ms | 3128 KiB | ||||
subtask2 | 20/20 | ||||||
2 | Elfogadva | 16ms | 3128 KiB | ||||
subtask3 | 0/30 | ||||||
3 | Hibás válasz | 18ms | 3128 KiB | ||||
subtask4 | 0/50 | ||||||
4 | Hibás válasz | 34ms | 3132 KiB | ||||
5 | Hibás válasz | 39ms | 3128 KiB | ||||
6 | Hibás válasz | 41ms | 3320 KiB |