Universal Cup Judging System

Universal Cup

시간 제한: 1.0 s 메모리 제한: 512 MB 총점: 100
통계

Ana 和 Bob 玩以下遊戲。

首先,Bob 選擇一個由 $n$ 個正整數組成的序列 $a_1, a_2, \dots, a_n$。接著 Ana 可以執行以下操作:

  • 她可以擦除序列中的任意數字,但不能把所有數字都擦除(至少必須留下一個數字)。
  • 對於每個留下的數字,她可以在其前面放一個 + 或 - 號。

之後,Ana 計算留下的數字的總和。如果她能得到一個能被 $m$ 整除的總和,她就獲勝。否則,Bob 獲勝。

給定 $n$ 和 $m$,請判斷哪位玩家擁有必勝策略。

輸入格式

第一行包含一個整數 $t$ —— 測試資料的組數。 接下來的 $t$ 行,每行包含兩個整數 $n$ 和 $m$。

輸出格式

對於每組測試資料,輸出一行:

  • Ana —— 如果 Ana 擁有必勝策略,
  • Bob —— 如果 Bob 擁有必勝策略。

資料範圍

$1 \le t \le 10^5$, $1 \le n, m \le 10^{18}$.

範例

輸入格式 1

3
1 2
2 3
3 8

輸出格式 1

Bob
Ana
Bob

說明

在第一組測試資料中,Bob 可以選擇 $a_1 = 3$。 在第二組測試資料中,無論 Bob 如何選擇 $a_1, a_2$,Ana 都有必勝策略。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.