题目描述
It's New Year's Day, and Balsa and Koca are stuck inside watching the rain. They decide to invent a game, the rules for which are described below.
Given array $\boldsymbol{a}$ containing $n$ integers, they take turns making a single move. Balsa always moves first, and both players are moving optimally (playing to win and making no mistakes).
During each move, the current player chooses one element from $\boldsymbol{a}$, adds it to their own score, and deletes the element from $\boldsymbol{a}$; because the size of $\boldsymbol{a}$ decreases by $\mbox{1}$ after each move, $\boldsymbol{a}$'s size will be $\mbox{0}$ after $n$ moves and the game ends (as all elements were deleted from $\boldsymbol{a}$). We refer to Balsa's score as $S_{b}$ and Koca's score as $S_{k}$. Koca wins the game if |$S_{b}$-$S_{k}$| is divisible by $3$; otherwise Balsa wins.
Given $\boldsymbol{a}$, determine the winner.
Note: $S_b+S_k=a_0+a_1+...+a_{n-2}+a_{n-1}$.
Input Format
The first line contains an integer, $\mathbf{T}$, denoting the number of test cases.
Each test case is comprised of two lines; the first line has an integer $n$, and the second line has $n$ space-separated integers $a_0,a_1,\ldots,a_{n-2},a_{n-1}$ describing array $\boldsymbol{a}$.
Constraints
$1\leq T\leq100$
$1\leq a_i\leq2000$
$1\leq n\leq2000$
Subtasks
For $50\%$ score: $1\leq n\leq200$
For $\textbf{100\%}$ score: $1\leq n\leq2000$
Output Format
For each test case, print the winner's name on a single line; if Balsa wins print Balsa, otherwise print Koca.
Sample Input
2
3
7 6 18
1
3
Sample Output
Balsa
Koca
Explanation
Test Case 1
Array $a=\{7,6,18\}$. The possible play scenarios are:
$S_b=13$, $S_k=18$, $|S_b-S_k|=5$, and $5\%3\neq0$.
$S_b=24$, $S_k=7$, $|S_b-S_k|=17$, and $17\%3\neq0$.
$S_b=25$, $S_k=6$, $|S_{b}$-$S_k|=19$, and $19\%3\neq0$.
In this case, it doesn't matter what Balsa chooses because the difference between their scores isn't divisible by $3$. Thus, Balsa wins.
Test Case 2
Array $a=\{3\}$. Balsa must choose that element, the first move ends the game.
$S_b=3$, $S_k=0$, $|S_b-S_k|=3$, and $3\%3=0$. Thus, Koca wins.
输入格式
见题面
输出格式
见题面