117142024-11-07 00:48:45KezdőPingpongpython3Wrong answer 50/10039ms3152 KiB
N = int(input())
for i in range(N):
    A,B = [int(i) for i in input().split()]
    if A == 33 and B <= 30:
        AA = [11,11,11]
        if B == 30:
            BB = [10,10,10]
        else:
            BB = [10]*(B//10) + [B%10]
            BB += [0]*(3-len(BB))
    elif 33 <= A <= 43 and 11 <= B <= 41:
        AA = [A%11,11,11,11]
        if B == 41:
            BB = [11,10,10,10]
        else:
            BB = [11] + [10]*((B-11)//10) + [(B-11)%10]
            BB += [0]*(4-len(BB))
    elif 33 <= A <= 53 and 22 <= B <= 52:
        if A == 53:
            AA = [10,10,11,11,11]
        else:
            AA = [(A-33)%10] + [10]*((B-33)//10)
            AA += [0]*(2-len(AA)) + [11,11,11]
        if B == 52:
            BB = [11,11,10,10,10]
        else:
            BB = [11,11] + [10]*((B-22)//10) + [(B-22)%10]
            BB += [0]*(5-len(BB))
    else:
        AA = [-1]
        BB = [-1]
##    print(AA)
##    print(BB)
    for i in range(len(AA)):
        print(AA[i],BB[i])
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3128 KiB
subtask220/20
2Accepted16ms3152 KiB
subtask330/30
3Accepted18ms3128 KiB
subtask40/50
4Wrong answer30ms3124 KiB
5Wrong answer35ms3124 KiB
6Wrong answer39ms3128 KiB