Orig Description
Score : 500 points
Problem StatementAlice and Brown loves games. Today, they will play the following game.
In this game, there are two piles initially consisting of X and Y stones, respectively.
Alice and Bob alternately perform the following operation, starting from Alice:
Take 2i stones from one of the piles. Then, throw away i of them, and put the remaining i in the other pile. Here, the integer i (1≤i) can be freely chosen as long as there is a sufficient number of stones in the pile.
The player who becomes unable to perform the operation, loses the game.
Given X and Y, determine the winner of the game, assuming that both players play optimally.
Constraints
0 ≤ X, Y ≤ 10^{18}
InputInput is given from Standard Input in the following format:
X Y
OutputPrint the winner: either Alice or Brown.
Sample Input 12 1
Sample Output 1Brown
Alice can do nothing but taking two stones from the pile containing two stones. As a result, the piles consist of zero and two stones, respectively. Then, Brown will take the two stones, and the piles will consist of one and zero stones, respectively. Alice will be unable to perform the operation anymore, which means Brown's victory.
Sample Input 25 0
Sample Output 2Alice
Sample Input 30 0
Sample Output 3Brown
Sample Input 44 8
Sample Output 4Alice
Extracted Specification
An integer X (0 ≤ X ≤ 10^18), representing some quantity.
An integer Y (0 ≤ Y ≤ 10^18), representing some quantity.
### Example Input:
```
2 1
```
### Function Signature:
Write a function f(X, Y) that takes in the input.
def f(X: int, Y: int):
'''
X: an integer
Y: an integer
'''
Test Case Generator
Sure, I can help you write a test case generator for this problem. Here is the code for the test case generator:
```python
import random
def tcgen():
# Generate a random number for X and Y within the given constraints
X = random.randint(0, 10**18)
Y = random.randint(0, 10**18)
return X, Y
# For demonstration, let's generate a few test cases
for _ in range(5):
print(tcgen())
```
This function `tcgen` generates random values for \(X\) and \(Y\) within the given range of \(0 \leq X, Y \leq 10^{18}\). Each call to `tcgen` will produce a new pair of \(X\) and \(Y\) which can be used as input for the game described in the problem statement.
If you'd like to see a few sample outputs from this generator, you can run the loop at the bottom of the code that prints out several test cases.
Here is more detailed implementation, including the sample output generation:
```python
import random
def tcgen():
# Generate random values for X and Y within the given range
X = random.randint(0, 10**18)
Y = random.randint(0, 10**18)
return X, Y
def main():
# Generate a number of test cases
num_cases = 10
for _ in range(num_cases):
X, Y = tcgen()
print(f"{X} {Y}")
if __name__ == "__main__":
main()
```
This script will generate 10 test cases and print them in the format expected by the problem statement. Each line will contain two integers \(X\) and \(Y\) separated by a space. You can adjust `num_cases` to generate more or fewer test cases as needed.
Extract Arguments
def extract_arguments(fh):
X, Y = map(int, fh.readline().strip().split())
return X, Y