16 人解决,19 人已尝试。
19 份提交通过,共有 32 份提交。
4.1 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
A magician does the following magic trick. He puts W white balls and B black balls in his hat and asks someone from the audience, say Bob, to remove pairs of balls in whatever order Bob would desire. After removing a pair of balls, Bob is asked to place a white ball back into the hat if they are the same color. Otherwise he is asked to place a black ball into the hat.
When Bob is left with only one ball in the hat, he asks the magician what color the last ball is. Needless to say, the magician can’t see the order by which Bob does the replacements.
The problem is that the magician, like most magicians, is old and sometimes forgets how to do the trick. Being the kind person you are, you are going to help the magician.
For each pair of numbers (W,B) you are asked to output one of the following:
The first line of the input file contains the number of cases, N(0 < N ≤ 1000) . N test cases follow.
Each case contains W and B(W + B > 0,0 ≤ W ≤ 109,0 ≤ B ≤ 109) on a line separated by a space.
For each input case, you should output:
Case #X: Y
where X is the number of the test case and Y is either “WHITE”, “BLACK” or “UNKNOWN” as explained above. (quotes for clarity)
2 3 1 3 6
Case #1: BLACK Case #2: WHITE
16 人解决,19 人已尝试。
19 份提交通过,共有 32 份提交。
4.1 EMB 奖励。