183452025-10-20 18:48:07algoproPingpongpypy3Time limit exceeded 50/100125ms25952 KiB
# UUID: 07a2ce4c-24f8-4bec-b4e4-204d42e7914e
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
1Accepted37ms19596 KiB
subtask220/20
2Accepted39ms19948 KiB
subtask330/30
3Accepted61ms21992 KiB
subtask40/50
4Time limit exceeded115ms25952 KiB
5Time limit exceeded125ms25228 KiB
6Time limit exceeded119ms25000 KiB