182072025-10-13 20:13:47LazurAndrasPingpongpypy3Time limit exceeded 50/100140ms25752 KiB
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
1Accepted39ms19552 KiB
subtask220/20
2Accepted45ms19948 KiB
subtask330/30
3Accepted61ms21992 KiB
subtask40/50
4Time limit exceeded140ms25752 KiB
5Time limit exceeded115ms25256 KiB
6Time limit exceeded119ms24944 KiB