{"problem":{"name":"Triangle Card Game","description":{"content":"Alice and Bob will play a game. Initially, Alice and Bob each have $N$ cards, with the $i$\\-th card of Alice having the integer $A_i$ written on it, and the $i$\\-th card of Bob having the integer $B_i","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc170_d"},"statements":[{"statement_type":"Markdown","content":"Alice and Bob will play a game.\nInitially, Alice and Bob each have $N$ cards, with the $i$\\-th card of Alice having the integer $A_i$ written on it, and the $i$\\-th card of Bob having the integer $B_i$ written on it.\nThe game proceeds as follows:\n\n*   Prepare a blackboard with nothing written on it.\n*   Alice eats one of her cards and writes the integer from the eaten card on the blackboard.\n*   Next, Bob eats one of his cards and writes the integer from the eaten card on the blackboard.\n*   Finally, Alice eats one more of her cards and writes the integer from the eaten card on the blackboard.\n\nIf it is possible to form a (non-degenerate) triangle with the side lengths of the three integers written on the blackboard, Alice wins; otherwise, Bob wins.\nDetermine who wins when both players act optimally.\nSolve each of the $T$ given test cases.\n\n## Constraints\n\n*   $1 \\leq T \\leq 10^5$\n*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq A_i, B_i \\leq 10^9$\n*   All input values are integers.\n*   The sum of $N$ over all test cases in a single input is at most $2 \\times 10^5$.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\mathrm{case}_1$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach case is given in the following format:\n\n$N$\n$A_1$ $\\ldots$ $A_N$\n$B_1$ $\\ldots$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc170_d","tags":[],"sample_group":[["3\n3\n1 2 3\n4 5 6\n4\n6 1 5 10\n2 2 4 5\n10\n3 1 4 1 5 9 2 6 5 3\n2 7 1 8 2 8 1 8 2 8","Bob\nAlice\nAlice\n\nIn the first test case, for example, the game could proceed as follows:\n\n*   Alice eats the card with $2$ written on it and writes $2$ on the blackboard.\n*   Bob eats the card with $4$ written on it and writes $4$ on the blackboard.\n*   Alice eats the card with $1$ written on it and writes $1$ on the blackboard.\n*   The numbers written on the blackboard are $2, 4, 1$. There is no triangle with side lengths $2, 4, 1$, so Bob wins.\n\nFor this test case, the above process is not necessarily optimal for the players, but it can be shown that Bob will win if both players act optimally."]],"created_at":"2026-03-03 11:01:14"}}