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 another 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'll write a test case generator for the given problem statement. Below is the `tcgen()` function to generate random test cases for the "Alice and Brown" game problem.
```python
import random
def tcgen():
# Generate random values for X and Y within the given constraints
X = random.randint(0, 10**18)
Y = random.randint(0, 10**18)
return X, Y
# Example of generating a test case
for _ in range(5):
print(tcgen())
```
This function will generate random values for \(X\) and \(Y\) within the specified range of \(0 \leq X, Y \leq 10^{18}\). You can call this function to generate multiple test cases. Each call to `tcgen()` will return a tuple with two integers, \(X\) and \(Y\), representing the initial number of stones in the two piles.
Here's how you might use this function to produce a few test cases:
```python
# Generate and print 5 example test cases
for _ in range(5):
print(tcgen())
```
This would output something like:
```
(123456789012345678, 987654321098765432)
(0, 999999999999999999)
(12345678901234567, 0)
(500500500500500500, 999999999999999999)
(0, 0)
```
Feel free to run this in your local environment to generate test cases as needed!
Extract Arguments
def extract_arguments(fh):
X, Y = map(int, fh.readline().strip().split())
return X, Y