#K52757. Sum of Even Integers

    ID: 29380 Type: Default 1000ms 256MiB

Sum of Even Integers

Sum of Even Integers

You are given \( T \) test cases. For each test case, a list of integers is provided. Your task is to compute the sum of the even integers for each test case.

Formally, given a list of integers \( a_1, a_2, \dots, a_n \), you need to compute the sum \[ S = \sum_{i=1}^{n} \mathbf{1}_{\{a_i \text{ is even}\}} \cdot a_i, \] where \( \mathbf{1}_{\{a_i \text{ is even}\}} \) is 1 if \( a_i \) is even and 0 otherwise.

Note that the input is provided via standard input and the output must be printed to standard output. Negative integers are allowed.

inputFormat

The first line of input contains an integer \( T \) representing the number of test cases. Each of the following \( T \) lines contains a sequence of space-separated integers representing a single test case.

outputFormat

For each test case, output a single line containing the sum of the even integers in that test case.

## sample
1
1 2 3 4 5 6
12

</p>