Alice loves to play with cubes and this time Santa gifted her a magical cube made up of some unit cubes (unity dimensions). She can spin the cube in two directions – clockwise and anticlockwise. The magic is – on spinning clockwise the cube grows in size such that more number of unit cubes get layered up on the original cube to make it a new one and on spinning anticlockwise the cube shrinks in size in a similar manner. A single spin adds or removes a single layer of unit cubes from the original one. Given the initial size of the cube and a sequence of spins – 0 denoting clockwise and 1 denoting anticlockwise, you need to print the absolute change in number of unit cubes.
NOTE: The input would always result in a valid cube.
INPUT
The first line contains T (1 <= T <= 1000) – the number of test cases, followed by T test cases. Each test case has two lines.
The first line contains two space separated integers N (1<=N<=100000) and K (1<=K<=100000) denoting the dimension of original cube and number of spins.
The next line contains K space separated 0s or 1s denoting a clockwise or anticlockwise spin.
OUTPUT
For each test case, print the number of unit cubes changed (increased or decreased) from the original cube.
Initially the cube was a unit cube – underwent three spins – two clockwise and one anticlockwise such that it resulted in a cube of size 3. Therefore change in number of unit cubes is 26.