CF1842A Tenzing and Tsondu
题目描述
Tsondu 总是跑第一!!!
Tsondu 和 Tenzing 正在玩纸牌游戏。Tsondu 有 $n$ 个怪物,它们的能力值为 $a_1,a_2,\ldots a_n$,而 Tenzing 有 $m$ 个怪物,它们的能力值为 $b_1,b_2,\ldots,b_m$。
Tsondu 和 Tenzing 轮流出招,Tsondu 先走。在每一步棋中,当前玩家选择两个怪物:一个在他们这边,一个在另一边。然后,这些怪物会互相争斗。假设所选怪物的能力值分别为 $x$ 和 $y$,那么怪物的能力值将分别变为 $x-y$ 和 $y-x$。如果任何怪物的能力值 $\le0$,则该怪物死亡。 当至少一个玩家没有活着的怪物时,游戏结束。赢家是至少有一个怪物活着的玩家。如果两个玩家都没有活着的怪物,游戏以平局结束。 当两个玩家都发挥到最佳状态时,找出游戏的结果。
输入格式
每个测试包含多个测试用例。第一行输入包含一个整数 $t$($1\le t\le2\cdot 10^3$)——测试用例的数量。测试用例的描述如下。
每个测试用例的第一行包含两个整数 $n$ 和 $m$($1\leq n,m\leq50$)——Tsondu 和 Tenzing 分别拥有的怪物数量。
每个测试用例的第二行包含 $n$ 个整数 $a_1,a_2,\ldots,a_n(1\leq a_i\leq10^9$)——Tsondu 怪物的能力值。
每个测试用例的第三行包含 $m$ 个整数 $b_1,b_2,\ldots,b_m(1\leq b_i\leq10^9$)——Tenzing 的怪物的能力值。
输出格式
对于每个测试用例,如果 Tsondu 赢了,则输出 `Tsondu`,如果 Tenzing 赢了,则输出 `Tenzing`,如果游戏以平局结束,则输出 `Draw`。(输出不带引号。) 注意,输出是区分大小写的。例如,如果答案是 `Tsondu`,则输出 `tsondu`、`TSONDU` 和 `tSonDu` 都将被识别为错误的输出。
## 样例解释
第一个样例中,可以看出 Tsondu 有必胜的策略。下面是 Tsondu 获胜的一种可能方式(请注意,在本例中,玩家可能没有发挥出最佳状态):
- 第一步,Tsondu 选择一个能力值为 $9$ 的怪物与一个能力值为 $1$ 的怪物战斗,这两个怪物的能力值分别为 $8$ 和 $-8$。Tenzing 这边能力值为 $-8$ 的怪物死亡。
- 第二步,Tenzing 选择自己这边一个能力值 $2$ 的怪物与 Tsondu 这边一个能力值 $8$ 的怪物战斗,两个怪物的能力值分别变成 $-6$ 和 $6$ 了。Tenzing 这边能力值为 $-6$ 的怪物死亡。
- 第三招,Tsondu 选择自己这边一个能力值为 $6$ 的怪物与 Tenzing 这边一个能力值为 $3$ 的怪物战斗,两个怪物的能力值分别变为 $3$ 和 $-3$。Tenzing 这边能力值为 $-3$ 的怪物死亡。
- 现在,Tenzing 没有活着的怪物了,但是 Tsondu 仍然有活着的怪物,所以 Tsondu 赢了。
说明/提示
Consider the first test case. It can be shown that Tsondu has a winning strategy. The following is a possible way that Tsondu can win (note that the players may not be playing optimally in this example):
- In the first move, Tsondu chooses a monster with ability value $ 9 $ on his side to fight against a monster with ability value $ 1 $ on Tenzing's side, the ability value of both monsters become $ 8 $ and $ -8 $ respectively. The monster with ability value $ -8 $ on Tenzing's side dies.
- In the second move, Tenzing chooses a monster with ability value $ 2 $ on his side to fight against a monster with ability value $ 8 $ on Tsondu's side, the ability value of both monsters become $ -6 $ and $ 6 $ respectively. The monster with ability value $ -6 $ on Tenzing's side dies.
- In the third move, Tsondu chooses a monster with ability value $ 6 $ on his side to fight against a monster with ability value $ 3 $ onTenzing's side, the ability value of both monsters become $ 3 $ and $ -3 $ respectively. The monster with ability value $ -3 $ on Tenzing's side dies.
- Now, Tenzing has no monsters left alive. Since Tsondu still has monsters left alive, Tsondu wins.