239682026-02-03 00:47:31algoproPingpongpypy3Időlimit túllépés 50/100127ms23528 KiB
# UUID: 4cb01789-0307-4f0b-a287-e384aa50ca0b
from sys import stdin
input = stdin.readline

N = int(input())

def nyer(X,db,m):
    XX = [11]*db
    X -= 11*db
    while X >= 10:
        XX += [10]
        X -= 10
    if X > 0:
        XX += [X]
    XX += [0]*(m-len(XX))
    return XX
def pp():
    for i in range(N):
        A,B = [int(i) for i in input().split()]
##    A,B = 53,22
        if A == 33 and B <= 30:
            AA = nyer(A,3,3)[::-1]
            BB = nyer(B,0,3)
        elif 33 <= A <= 43 and 11 <= B <= 41:
            AA = nyer(A,3,4)[::-1]
            BB = nyer(B,1,4)
        elif 33 <= A <= 53 and 22 <= B <= 52:
            AA = nyer(A,3,5)[::-1]
            BB = nyer(B,2,5)
        else:
            AA = [-1]
            BB = [-1]
##    print(AA)
##    print(BB)
        for i in range(len(AA)):
            print(AA[i],BB[i])
pp()
RészfeladatÖsszpontTesztVerdiktIdőMemória
subtask10/0
1Elfogadva45ms19696 KiB
subtask220/20
2Elfogadva48ms21196 KiB
subtask330/30
3Elfogadva71ms21992 KiB
subtask40/50
4Elfogadva93ms23528 KiB
5Időlimit túllépés107ms23320 KiB
6Időlimit túllépés127ms23304 KiB