#K62522. Counting Even and Odd Numbers

    ID: 31550 Type: Default 1000ms 256MiB

Counting Even and Odd Numbers

Counting Even and Odd Numbers

You are given an array of integers. Your task is to count the number of even and odd numbers in the array. A number is even if \(n \mod 2 = 0\) and odd otherwise. In addition, the input will consist of several test cases. For each test case, you will be given an integer \(n\) denoting the number of elements in the array, followed by \(n\) integers. Your program should output two numbers for each test case: the count of even numbers and the count of odd numbers, separated by a space.

Input Format: The first line contains an integer \(T\), the number of test cases. For each test case, the first line contains the integer \(n\) (the number of elements in the array), and the second line contains \(n\) space-separated integers.

Output Format: For each test case, output a single line with two integers: the number of even and odd numbers respectively.

inputFormat

The input is read from stdin and has the following format:

T
n1
a1 a2 ... an1
n2
b1 b2 ... bn2
...

where \(T\) is the number of test cases. For each test case, \(n\) is the number of elements, followed by the list of \(n\) integers.

outputFormat

For each test case, print the count of even numbers followed by the count of odd numbers on a single line (separated by a space) to stdout.

## sample
3
5
1 2 3 4 5
4
2 4 6 8
3
1 3 5
2 3

4 0 0 3

</p>