309687: CF1719A. Chip Game

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Chip Game

题意翻译

有一个 $n$ 行 $m$ 列的方格矩阵,左下角的方格有一个棋子,这个棋子每次移动只能**向上或向右**移动**奇数**格。Burenka 和 Tonya 用这个棋子玩一个游戏:两人依次移动一次棋子,最后没法移动棋子的人就输了。Burenka 先手,给你 $n$ 和 $m$,问你谁最后会赢。我们假定他们都精通这个游戏,因此每一步走棋方式都是最优的。 输入第一行一个整数 $t(1\le t\le10^4)$,表示 $t$ 组数据。接下来 $t$ 行每行两个整数 $n,m(1\le n,m\le10^9)$,含义如题面所述。 对于每一组数据,输出一行一个字符串,表示游戏最后的赢家,即“Burenka”或“Tonya”。

题目描述

Burenka and Tonya are playing an old Buryat game with a chip on a board of $ n \times m $ cells. At the beginning of the game, the chip is located in the lower left corner of the board. In one move, the player can move the chip to the right or up by any odd number of cells (but you cannot move the chip both to the right and up in one move). The one who cannot make a move loses. Burenka makes the first move, the players take turns. Burenka really wants to win the game, but she is too lazy to come up with a strategy, so you are invited to solve the difficult task of finding it. Name the winner of the game (it is believed that Burenka and Tonya are masters of playing with chips, so they always move in the optimal way). ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1719A/a6c823a6eb354fdb9ffdf07a308c103419371a6a.png)Chip's starting cell is green, the only cell from which chip can't move is red. if the chip is in the yellow cell, then blue cells are all options to move the chip in one move.

输入输出格式

输入格式


The first line contains one integer $ t $ ( $ 1 \leq t \leq 10^4 $ ) — the number of test cases. The following is a description of the input data sets. The only line of each test case contains two integers $ n $ and $ m $ ( $ 1 \leq n, m \leq 10^9 $ ) — the dimensions of the game board.

输出格式


For each test case print a single line — the name of the winner of the game ("Burenka" or "Tonya").

输入输出样例

输入样例 #1

6
1 1
1 4
5 6
2 2
6 3
999999999 1000000000

输出样例 #1

Tonya
Burenka
Burenka
Tonya
Burenka
Burenka

说明

In the first case, Burenka has no move, so Tonya wins. In the second case, Burenka can move $ 3 $ cells to the right, after which Tony will not be able to make a move, which means that Burenka wins. In the third case, Burenka can move $ 5 $ squares to the right. Then we can say that we have a game on a board of $ 1 \times 5 $ cells, and Tonya is the first player. In such game the second player wins, so in the original one Burenka will win.

Input

题意翻译

有一个 $n$ 行 $m$ 列的方格矩阵,左下角的方格有一个棋子,这个棋子每次移动只能**向上或向右**移动**奇数**格。Burenka 和 Tonya 用这个棋子玩一个游戏:两人依次移动一次棋子,最后没法移动棋子的人就输了。Burenka 先手,给你 $n$ 和 $m$,问你谁最后会赢。我们假定他们都精通这个游戏,因此每一步走棋方式都是最优的。 输入第一行一个整数 $t(1\le t\le10^4)$,表示 $t$ 组数据。接下来 $t$ 行每行两个整数 $n,m(1\le n,m\le10^9)$,含义如题面所述。 对于每一组数据,输出一行一个字符串,表示游戏最后的赢家,即“Burenka”或“Tonya”。

Output

**题目大意:**
有一个棋子在一个 \( n \times m \) 的方格矩阵中,棋子初始在左下角。每次移动可以将棋子向上或向右移动奇数格。Burenka 和 Tonya 交替进行移动,不能移动者输。问最后谁会赢。

**输入数据格式:**
第一行一个整数 \( t(1 \le t \le 10^4) \),表示 \( t \) 组数据。接下来 \( t \) 行每行两个整数 \( n, m(1 \le n, m \le 10^9) \),表示矩阵的行数和列数。

**输出数据格式:**
对于每组数据,输出一行一个字符串,表示游戏最后的赢家,即“Burenka”或“Tonya”。**题目大意:** 有一个棋子在一个 \( n \times m \) 的方格矩阵中,棋子初始在左下角。每次移动可以将棋子向上或向右移动奇数格。Burenka 和 Tonya 交替进行移动,不能移动者输。问最后谁会赢。 **输入数据格式:** 第一行一个整数 \( t(1 \le t \le 10^4) \),表示 \( t \) 组数据。接下来 \( t \) 行每行两个整数 \( n, m(1 \le n, m \le 10^9) \),表示矩阵的行数和列数。 **输出数据格式:** 对于每组数据,输出一行一个字符串,表示游戏最后的赢家,即“Burenka”或“Tonya”。

加入题单

上一题 下一题 算法标签: