AtCoder Grand Contest 064
C
Erase and Divide Game
AtCoder
⌀ 2932
原题
← BD →
翻译中…

Problem Statement

翻译中…

Takahashi and Aoki will play the following game.

翻译中…
  1. For each $i=1,2,\ldots,N$ in this order, do the following.
  • Write each integer from $l_i$ through $r_i$ once on the blackboard. (Here, $l_i$ and $r_i$ are non-negative integers from the input.)
  1. While one or more integers are written on the blackboard, the players take turns doing the following, with Takahashi going first.
  • Choose and perform exactly one of the following two operations.
    • Delete all even numbers written on the blackboard, and replace each remaining integer with half its value rounded down to an integer.
      • Delete all odd numbers written on the blackboard, and replace each remaining integer with half its value.
  1. When no integer is written on the blackboard, the game ends and the last player to perform an operation wins.
翻译中…

It can be proved that the game ends in a finite number of operations if Takahashi and Aoki act optimally. Find the winner in this case.

翻译中…

Solve the above problem for $T$ cases.

翻译中…

Constraints

翻译中…
  • $1 \leq T \leq 10^4$
  • $1 \leq N \leq 10^4$
  • $0 \leq l_i \leq r_i \leq 10^{18}$
  • $r_i \lt l_{i+1}$
  • The sum of $N$ over the test cases in a single input is at most $10^4$.
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format, where $\mathrm{test}_i$ represents the $i$-th test case:

翻译中…

T
\mathrm{test}_1
\vdots
\mathrm{test}_T

翻译中…

Each test case is given in the following format:

翻译中…

N
l_1 r_1
\vdots
l_N r_N

翻译中…

Output

翻译中…

Print $T$ lines. The $i$-th line should contain Takahashi if Takahashi wins in the $i$-th test case, and Aoki if Aoki wins.

翻译中…

样例

Input #1
3
2
1 2
5 7
1
0 100
10
1312150450968413 28316250877914571
74859962623690078 84324828731963974
148049062628894320 252509054433933439
269587449430302150 335408917861648766
349993004923078531 354979173822804781
522842184971407769 578223540024979436
585335723211047194 615812229161735895
645762258982631926 760713016476190622
779547116602436424 819875141880895723
822981260158260519 919845426262703496
Output #1
Aoki
Aoki
Takahashi
Here is an example of how the game goes for the first test case. - Each of $1,2,5,6,7$ is written once on the blackboard. - Takahashi chooses to delete the odd numbers. $1,5,7$ are deleted from the blackboard, and the remaining integers $2,6$ are replaced by half their values, that is, $1,3$, respectively. - Aoki chooses to delete the odd numbers. $1,3$ are deleted from the blackboard, and no more integer is written on the blackboard, so the game ends and Aoki, who performed the last operation, wins.
题目信息
题号
agc064_c
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。