183072025-10-18 20:57:11algoproPingpongpypy3Time limit exceeded 50/100136ms25824 KiB
# UUID: ad6adb5e-c67c-4b82-9fe2-7155853d7fef
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 33 <= a <= 43 and 11 <= b <= 41:
        print(a-33, 11)
        b -= 11
        a = 33
        win(a, b)
    elif 33 <= a <= 53 and 22 <= 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
1Accepted45ms19436 KiB
subtask220/20
2Accepted39ms19948 KiB
subtask330/30
3Accepted61ms21988 KiB
subtask40/50
4Time limit exceeded118ms25824 KiB
5Time limit exceeded128ms25196 KiB
6Time limit exceeded136ms24944 KiB