#P11010. 『STA - R7』Divide and Merge Game
『STA - R7』Divide and Merge Game
Problem Description
Given two positive integers , Alice and Bob will play the following game:
-
Alice needs to provide a sequence of length consisting of positive integers, such that .
-
Bob needs to try to give a positive integer with , such that the positive integer sequence given by Alice can be partitioned into non-empty multisets, and the sums of elements in these multisets are all equal. If Bob can give such an integer , then Bob wins; otherwise, Alice wins.
Assuming both players use optimal strategies, determine who will win. You need to answer queries.
Input Format
This problem contains multiple queries in a single test file.
The first line contains a positive integer , representing the number of queries.
For each query: one line contains two positive integers , with the meaning described in the Description.
Output Format
For each query, output one line Alice or Bob, indicating who will win.
2
4 4
8 3
Bob
Alice
Hint
Sample Explanation
For the first group of testdata, Alice can only provide the positive integer sequence . Then Bob gives and partitions the sequence into $\left\{\left\{1\right\},\left\{1\right\},\left\{1\right\},\left\{1\right\}\right\}$. Bob can also give and partition the sequence into $\left\{\left\{1, 1\right\}, \left\{1, 1\right\}\right\}$, obtaining two multisets whose element sums are both , which also satisfies the requirement.
For the second group of testdata, Alice can provide the positive integer sequence . It can be proven that Bob has no valid partition plan at this time, so Alice wins.
Constraints
This problem uses bundled tests.
For of the data:
- ;
- .
The detailed subtask allocation is as follows:
| Subtask ID | Constraints | Score |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | No special restrictions |
Translated by ChatGPT 5