182052025-10-13 20:10:31algoproPingpongpypy3Time limit exceeded 50/100118ms25560 KiB
# UUID: f7a22087-e86a-48df-8f38-fd225db5f3ae
import sys
input = sys.stdin.readline

def win(a, b):
    print(11, min(10, b))
    b -= min(10, b)
    print(11, min(10, b))
    b -= min(10, b)
    print(11, min(10, b))

def solve():
    a, b = [int(x) for x in input().split()]
    if a == 33 and b <= 30: win(a, b)
    elif a >= 33 and a <= 43 and b >= 11 and b <= 41:
        print(a-33, 11)
        b -= 11
        a = 33
        win(a, b)
    elif a >= 33 and a <= 53 and b >= 22 and b <= 52:
        print(min(10, a-33), 11)
        a -= min(10, a-33)
        print(a-33, 11)
        a = 33
        b -= 22
        win(a, b)
    else: print(-1, -1)
         

t = int(input())
while t > 0:
    t -= 1
    solve()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted39ms19704 KiB
subtask220/20
2Accepted39ms20136 KiB
subtask330/30
3Accepted68ms21992 KiB
subtask40/50
4Time limit exceeded115ms25560 KiB
5Time limit exceeded118ms25292 KiB
6Time limit exceeded116ms24804 KiB