#C9244. Even-Odd Array Transformation
Even-Odd Array Transformation
Even-Odd Array Transformation
Given a set of test cases, each containing an array of integers, your task is to output a new array where each element is replaced by 0 if the corresponding number is even, or 1 if it is odd.
For each integer (a) in the input array, the transformation is defined as follows:
(\text{result} = \begin{cases} 0 & \text{if } a \equiv 0 \pmod{2} \ 1 & \text{if } a \equiv 1 \pmod{2} \end{cases})
This problem tests your ability to read input, process arrays, and apply conditional logic.
inputFormat
The first line contains an integer (T) representing the number of test cases.
For each test case, the first line contains an integer (N) denoting the number of elements in the array. The next line contains (N) space-separated integers.
outputFormat
For each test case, output a single line containing (N) space-separated integers. Each integer should be 0 if the corresponding input integer is even, or 1 if it is odd.## sample
1
5
1 2 3 4 5
1 0 1 0 1
</p>