Not able understand question

please explain the test cases

2
2
4 2
3
5 2 3
first 2 is the number of test cases
now second 2 is the number of piles, that is size of the array u need to input
4 & 2 denotes elements of the array and the number of stones in each pile
first a has his turn his options are:
convert 4 into 2 piles of 2 or 4 piles of 1
or convert the pile of 2 into 2 piles of 1
consider he convert 4 into 2 piles of 2
now turnwise a and b will break 3 piles of two into 2 piles of 1 and hence in the order BAB and hence B wins
now consider A converts 4 to 4 piles of 1, B makes the next move and he wins
now consider A converts pile of 2 into 2 of one each, NOW B converts 4 into 4 piles of one and he wins