239972026-02-03 09:29:09algoproPingpongpypy3Időlimit túllépés 50/100134ms25144 KiB
# UUID: 78ef0b31-4500-44af-86d1-939ead27918e
from sys import stdin
input = stdin.readline

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)
RészfeladatÖsszpontTesztVerdiktIdőMemória
subtask10/0
1Elfogadva39ms19692 KiB
subtask220/20
2Elfogadva43ms21224 KiB
subtask330/30
3Elfogadva61ms21988 KiB
subtask40/50
4Időlimit túllépés134ms25144 KiB
5Időlimit túllépés112ms24896 KiB
6Időlimit túllépés115ms24148 KiB