You are given an array A containing \(2 \cdot N\) inetegers. You want to obtain exactly \(N\) even integers in the array. Is it possible to achieve the goal using the following operation any number of times(possibly zero) ?
- Choose two distinct indices \(i, \; j \;(1 \le i, j \le N, i\neq j )\) such that \(A_i\) is an even integer, then set \(A_i = \frac{A_i}{2} ,\; A_j = A_j \cdot 2\)
Input format
- The first line contains T denoting the number of test cases. The description of T test cases is as follows:
- For each test case:
- The first line contains an integer \(N\) where \(2 \cdot N\) denotes size of array A.
- The second line contains \(2\cdot N\) space-separated integers \(A_1, A_2, \dots, A_{2\cdot N}\) - denoting the elements of A.
Output format
For each test case, print "YES" (without quotes) if it is possible to achieve the goal and "NO" (without quotes) otherwise.
Constraints
The sum of \(N\) over all test cases does not exceed \(2 \cdot 10^5\).
In the first test case, it is impossible to have two even integers in the given array.
In the second test case, apply the operation on indices \(i = 1, j = 2\) making \(A = [4, 10, 1, 3]\) which contains two even integers,
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor