#K55972. Sum of Even Numbers
Sum of Even Numbers
Sum of Even Numbers
Given several test cases, each test case consists of a list of integers. For each test case, compute the sum of all even numbers. If there are no even numbers, the result is 0.
You are required to process the input from stdin and output the result to stdout. The problem tests your ability to parse input and apply basic arithmetic operations.
An integer n is even if it satisfies the equation: $$ n \mod 2 = 0 $$.
inputFormat
The input begins with an integer T
(1 ≤ T ≤ 105) representing the number of test cases. Each test case is given in one line starting with an integer N
(the number of integers in that test case), followed by N
space-separated integers.
Example:
2 5 1 2 3 4 5 4 -1 -2 -3 -4
outputFormat
For each test case, output a single line containing the sum of even numbers in that test case.
Example output for the above sample:
6 -6## sample
1
5 1 2 3 4 5
6
</p>