Destructive Game
시간 제한2초메모리 제한1024 MB
각 더미에서 b_i^k개의 돌을 제거하는 게임의 그런디 수를 구해 모두 XOR한 값으로 승자를 판정한다.
문제
There are stone piles, numbered by sequential integers from to . The -th pile contains stones. Additionally, each pile has an integer associated with it.
Alice and Bob play the following game using those stone piles.
They are alternately performing the following operation: choose pile and a nonnegative integer such that is not greater than the current number of stones in pile , and remove stones from pile . If a player cannot do that on their turn, the opposite player wins.
Alice moves first. Determine who will win if both players are playing optimally.
입력
The first line of input contains one integer (), the number of piles. The -th of the following lines contains two integers and (): the initial number of stones in the -th pile and the integer associated with it, respectively.
출력
If Alice wins the game when both sides are playing optimally, print "Alice". Otherwise, print "Bob".