117422024-11-08 15:31:37XetoxinoPingpongpython3Wrong answer 20/10041ms3320 KiB
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]
    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3128 KiB
subtask220/20
2Accepted16ms3128 KiB
subtask30/30
3Wrong answer18ms3128 KiB
subtask40/50
4Wrong answer34ms3132 KiB
5Wrong answer39ms3128 KiB
6Wrong answer41ms3320 KiB