Make XOR zero

Read problems statements in Mandarin Chinese , Russian and Vietnamese
Olya has written N binary integers (i.e. either zero or one) on a blackboard. She recently learned about XOR operation. Now she wants to erase exactly one integer in the array so that the XOR of the remaining N  1 numbers is zero. Please help her to calculate the number of ways of doing so.
Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains a single integer N denoting the number of numbers that Olya has written on a blackboard.
The second line contains N spaceseparated integers A_{1}, A_{2}, ..., A_{N} denoting the numbers she had written.
Output
For each test case, output a single line containing the number of ways to erase exactly one integer so that the XOR of the remaining integers is zero. The ways where you erase the same integer but on different places in the given sequence are considered different.Constraints
 1 ≤ T ≤ 20
 2 ≤ N ≤ 10^{5}
 0 ≤ A_{i} ≤ 1
Example
Input: 2 5 1 0 0 0 0 5 1 1 1 1 1 Output: 1 5
Explanation
Example case 1. If you erase the first number on the blackboard, then the XOR of the rest of numbers will be equal to zero.
Example case 2. You can erase any of the given 5 numbers, it will make the XOR of the rest equal to zero.
Author:  xcwgf666 
Tags  adhoc, counting, snck151b, xcwgf666 
Date Added:  13052015 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions