257462026-03-01 15:30:36algoproPingpongpypy3Wrong answer 20/100114ms24184 KiB
# UUID: 772a33e3-8cbb-4070-ad4f-d153a6d737b2
t = int(input())

eltarol = False
for i in range(t):
    a, b = map(int, input().split())
    if a < 33 or a > 53:
        print("-1 -1")
    else:
        a -= 33
        if a > 10:
            a -= 10
            b -= 11
            if b >= 0:
                eltarol = True
            else:
                print("-1 -1")
                continue

        if a > 0:
            b -= 11
            if b >= 0:
                print(f"{a} 11")
            else:
                eltarol = False
                print("-1 -1")
                continue
        
        if b > 9:
            b -= 10
            print("11 10")

            if b > 9:
                b -= 10
                print("11 10")
            else:
                print("11 0")
        else:
            print("11 0")
            print("11 0")
        if eltarol:
            print("10 11")
        print(f"11 {b}")
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted45ms19436 KiB
subtask220/20
2Accepted46ms19680 KiB
subtask30/30
3Wrong answer68ms21992 KiB
subtask40/50
4Time limit exceeded114ms24140 KiB
5Time limit exceeded108ms23484 KiB
6Time limit exceeded114ms24184 KiB