Binary String Battle
Alice and Bob are given a binary string
Alice wins if she is able to transform all characters of
Alice and Bob take turns, with Alice going first.
- On Alice's turn, she may choose any subsequence
∗ of lengthk ins , then set all characters in that subsequence to zero. - On Bob's turn, he may choose any substring
† of lengthk ins , then set all characters in that substring to one.
Note that Alice wins if the string consists of all zeros at any point during the game, including in between Alice's and Bob's turns.
Determine who wins with optimal play.
The first line contains an integer
The first line of each test case contains two integers
The second line of each test case contains a binary string
It is guaranteed that the sum of
For each test case, output on a single line "Alice" if Alice wins with optimal play, and "Bob" if Bob wins with optimal play.
You can output the answer in any case (upper or lower). For example, the strings "aLiCe", "alice", "ALICE", and "alICE" will be recognized as "Alice".
65 2110117 410110116 10100004 111118 3101101106 4111111
Bob Alice Alice Bob Bob Alice
In the third sample, Alice can choose the subsequence consisting of
In the fourth sample, it can be shown that there is no way for Alice to guarantee that she can turn