176942025-09-14 16:49:47algoproPingpongpypy3Wrong answer 20/100136ms65536 KiB
# UUID: 6ebd04e7-e6ff-49c4-a21e-2c1dde60b697
merkozesek = int(input())
eredmenyek = []
for i in range(merkozesek):
    eredmenyek.append(list(map(int, input().strip().split())))

def harombol(b):
    if b<11:
        return [b, 0, 0]
    elif b-10<11:
        return [10, b-10, 0]
    else:
        return [10, 10, b-20]

def tobbol(a, b):
    jatszmak = int(a/11)+1
    apoints = []
    bpoints = []

    if jatszmak == 4 and b<52:
        apoints.append(a%11) 
        bpoints.append(11)
        if a-a%11 == 33:
            bpoints = bpoints + harombol(b-11)
            apoints += [11,11,11]
        return (apoints, bpoints)
    else:
        apoints.append(5 if a % 11 == 0 else a % 11)
        bpoints.append(11)
        apoints.append(6 if a % 11 == 0 else 0)
        bpoints.append(11)
        if a-a%11 == 33 or a%11 == 0:
            bpoints = bpoints + harombol(b-22)
            apoints += [11,11,11]
        return (apoints, bpoints) 


for i in eredmenyek:
    if i[0]<33 or i[0] == i[1] or (i[0]==33 and i[1]>=33):
        print(-1, -1)
    elif i[0] == 33:
        bs = harombol(i[1])
        for i in range(3):
            print(11, bs[i])
    else:
        a, b = tobbol(i[0],i[1])
        for i in range(len(a)):
            print(a[i], b[i])
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted71ms65536 KiB
subtask220/20
2Accepted45ms24256 KiB
subtask30/30
3Wrong answer78ms26856 KiB
subtask40/50
4Time limit exceeded118ms24292 KiB
5Time limit exceeded136ms24784 KiB
6Time limit exceeded126ms24548 KiB