Problem - 1719A - Codeforces
codeforces.com
- 제목
Chip Game
- 조건
time limit per test : 1 second
memory limit per test : 256 megabytes
input : standard input
output : standard output
- 문제
Burenka and Tonya are playing an old Buryat game with a chip on a board of n×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).
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≤t≤104) — 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≤n,m≤109) — 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 | 예제 출력1 |
6 1 1 1 4 5 6 2 2 6 3 999999999 1000000000 |
Tonya Burenka Burenka Tonya Burenka Burenka |
#include <iostream>
#include <algorithm>
using namespace std;
#define endl '\n'
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int tc, row, col;
cin >> tc;
for(int n = 0 ; n < tc ; n++){
int cnt =0;
cin >> row >> col;
row--;
col--;
if((row + col) % 2 == 0) cout << "Tonya" << endl;
else cout << "Burenka" << endl;
}
return 0;
}