226992026-01-15 16:50:58vyrallAI rizikópython3Accepted 100/10017ms3064 KiB
import sys

# uncomment the two following lines if you want to read/write from files
# sys.stdin = open('input.txt')
# sys.stdout = open('output.txt', 'w')

T = int(input().strip())
for test in range(1, T+1):
    N, M = map(int, input().strip().split())
    W = ""

    tomma = N // 3 * 2

    if N % 3 < 2:
        if M <= tomma:
            W = "tommaso"
        elif M == tomma + 1:
            W = "draw"
        else:
            W = "filippo"
    else:
        if M <= tomma + 1:
            W = "tommaso"
        elif M == tomma + 2:
            W = "draw"
        else:
            W = "filippo"
    print(W)

sys.stdout.close()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted14ms2868 KiB
subtask230/30
2Accepted16ms2868 KiB
3Accepted17ms2864 KiB
subtask330/30
4Accepted16ms2868 KiB
5Accepted17ms2864 KiB
6Accepted16ms3064 KiB
7Accepted16ms2860 KiB
subtask440/40
8Accepted16ms2868 KiB
9Accepted16ms2868 KiB
10Accepted17ms2864 KiB
11Accepted16ms3064 KiB
12Accepted16ms2860 KiB
13Accepted16ms2956 KiB
14Accepted14ms2868 KiB