239962026-02-03 09:27:22algoproPingpongpypy3Time limit exceeded 50/100135ms24664 KiB
# UUID: 2eb3688f-39a6-4b9e-ac0a-2f834144be1d
N = int(input())

def veszt(X):
    if X > 10:
        return 10, X-10
    else:
        return X, 0

for i in range(N):
    A,B = [int(i) for i in input().split()]
#    A,B = 53,22
    if A == 33 and B <= 30:
        p,B = veszt(B)
        print(11,p)
        p,B = veszt(B)
        print(11,p)
        p,B = veszt(B)
        print(11,p)
        
    elif 33 <= A <= 43 and 11 <= B <= 41:
        print(A-33,11)
        A,B = 33,B-11
        p,B = veszt(B)
        print(11,p)
        p,B = veszt(B)
        print(11,p)
        p,B = veszt(B)
        print(11,p)
    elif 33 <= A <= 53 and 22 <= B <= 52:
        p,A = veszt(A)
        print(p,11)
        print(A-33,11)
        A,B = 33,B-11
        p,B = veszt(B)
        print(11,p)
        p,B = veszt(B)
        print(11,p)
        p,B = veszt(B)
        print(11,p)
    else:
        print(-1,-1)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted39ms19700 KiB
subtask220/20
2Accepted43ms21228 KiB
subtask330/30
3Accepted68ms21736 KiB
subtask40/50
4Time limit exceeded129ms24552 KiB
5Time limit exceeded135ms24664 KiB
6Time limit exceeded131ms24352 KiB