CF1921E.Eat the Chip

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Alice and Bob are playing a game on a checkered board. The board has hh rows, numbered from top to bottom, and ww columns, numbered from left to right. Both players have a chip each. Initially, Alice's chip is located at the cell with coordinates (xa,ya)(x_a, y_a) (row xax_a , column yay_a ), and Bob's chip is located at (xb,yb)(x_b, y_b) . It is guaranteed that the initial positions of the chips do not coincide. Players take turns making moves, with Alice starting.

On her turn, Alice can move her chip one cell down or one cell down-right or down-left (diagonally). Bob, on the other hand, moves his chip one cell up, up-right, or up-left. It is not allowed to make moves that go beyond the board boundaries.

More formally, if at the beginning of Alice's turn she is in the cell with coordinates (xa,ya)(x_a, y_a) , then she can move her chip to one of the cells (xa+1,ya)(x_a + 1, y_a) , (xa+1,ya1)(x_a + 1, y_a - 1) , or (xa+1,ya+1)(x_a + 1, y_a + 1) . Bob, on his turn, from the cell (xb,yb)(x_b, y_b) can move to (xb1,yb)(x_b - 1, y_b) , (xb1,yb1)(x_b - 1, y_b - 1) , or (xb1,yb+1)(x_b - 1, y_b + 1) . The new chip coordinates (x,y)(x', y') must satisfy the conditions 1xh1 \le x' \le h and 1yw1 \le y' \le w .

Example game state. Alice plays with the white chip, Bob with the black one. Arrows indicate possible moves. A player immediately wins if they place their chip in a cell occupied by the other player's chip. If either player cannot make a move (Alice—if she is in the last row, i.e. xa=hx_a = h , Bob—if he is in the first row, i.e. xb=1x_b = 1 ), the game immediately ends in a draw.

What will be the outcome of the game if both opponents play optimally?

输入格式

Each test consists of multiple test cases. The first line contains a single integer tt ( 1t1041 \le t \le 10^4 ) — the number of test cases. This is followed by the description of the test cases.

Each test case consists of a single line containing six integers hh , ww , xax_a , yay_a , xbx_b , yby_b ( 1xa,xbh1061 \le x_a, x_b \le h \le 10^6 , 1ya,ybw1091 \le y_a, y_b \le w \le 10^9 ) — the dimensions of the board and the initial positions of Alice's and Bob's chips. It is guaranteed that either xaxbx_a \ne x_b or yayby_a \ne y_b .

It is guaranteed that the sum of hh over all test cases does not exceed 10610^6 .

输出格式

For each test case, output "Alice" if Alice wins, "Bob" if Bob wins, and "Draw" if neither player can secure a victory. You can output each letter in any case (lowercase or uppercase). For example, the strings "bOb", "bob", "Bob", and "BOB" will be accepted as Bob's victory.

输入输出样例

  • 输入#1

    12
    6 5 2 2 5 3
    4 1 2 1 4 1
    1 4 1 3 1 1
    5 5 1 4 5 2
    4 4 1 1 4 4
    10 10 1 6 10 8
    10 10 2 6 10 7
    10 10 9 1 8 1
    10 10 8 1 10 2
    10 10 1 1 2 1
    10 10 1 3 4 1
    10 10 3 1 1 1

    输出#1

    Alice
    Bob
    Draw
    Draw
    Draw
    Alice
    Draw
    Draw
    Bob
    Alice
    Alice
    Draw
首页