#P6814. [PA 2009] Circular Game
[PA 2009] Circular Game
Description
There is a circular board of size , with white pieces and black pieces on it.
White moves first. In one move, a piece may move to a position such that there are no pieces on any position in between.
For example, in the figure below, the piece at position can move to any of positions .

Input Format
The first line contains an integer , the number of test cases.
For each test case, the first line contains three integers , , and , representing the board length, the number of white pieces, and the number of black pieces.
The second line of each test case contains a strictly increasing sequence of integers, representing the positions of the white pieces.
The third line of each test case contains a strictly increasing sequence of integers, representing the positions of the black pieces.
Output Format
For each test case, output a single character: , , or .
Output if White wins, output if Black wins, and output if the game never ends.
3
9 2 3
3 8
2 5 6
6 2 2
5 6
2 4
7 1 1
3
4
C
B
R
Hint
Constraints: , .
Translated by ChatGPT 5
京公网安备 11011102002149号