BETA
School Problem's Submission isn't counted in score!

Total Submissions: 2338 Accuracy:

32.38%

Minimum number to form the sum even
       

Given an array, write a program to add the minimum number(should be greater than 0) to the array so that the sum of array becomes even

Input:
The first line of input contains an integer T denoting the number of test cases. The first and last line of each test case consists of an integer n. Next line of each test case cinsists of n spaced integers.

Output:
Print the minimum number required to the array so that the sum becomes even .

Constraints: 
1<=T<=100
1<=n<=1000
1<=a[i]<=100000

Example:
Input:

2
8
1 2 3 4 5 6 7 8
9
1 2 3 4 5 6 7 8 9

Output:
2
1

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.