|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||0||0||0||0.000%|
Whenever the weather outside is bad, Lora and Bobi enjoy playing board games together. One of their favorite games is the board game Activity – in this task we will describe a generalization of the game.
The game consists of a strip divided in N spaces numbered from 1 to N. Each of the two players (Lora and Bobi) has a token that is initially placed on the space numbered 1. The players take turns to move their own token forwards. In a single turn the rules are as follows:
Note that each player must make a move on their turn and cannot “pass”. The winner is the player whose token ends up on space number N first. As a lady, Lora gets to make the first move.
A single game can be fully described by the quadruple (N, L, B, K). Now Lora and Bobi are wondering who would win if they both play optimally given different parameters for the game. It is possible that with optimal strategy from both players a game continues forever. In such case we consider the game to be a draw.
On the first line of the standard input is a single integer T – the number of games that your program should process.
Each of the next T lines contains 4 space-separated integers – N, L, B and K – respectively the amount of spaces in the game, Lora’s maximum move, Bobi’s maximum move and the number of spaces that one gets pushed back when the two tokens end up on the same space.
For every game output on a separate line the result of the game with the given parameters assuming that both players play optimally. The possibilities are:
3 10 4 3 2 5 2 3 1 4 2 2 2
Lora Bobi Draw