## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] Patchouli's Magical Talisman Codeforces Solution | Codeforces Problem Solution 2022

B. Patchouli's Magical Talisman
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Patchouli is making a magical talisman. She initially has $n$ magical tokens. Their magical power can be represented with positive integers ${a}_{1},{a}_{2},\dots ,{a}_{n}$.

Patchouli may perform the following two operations on the tokens.

• Fusion: Patchouli chooses two tokens, removes them, and creates a new token with magical power equal to the sum of the two chosen tokens.
• Reduction: Patchouli chooses a token with an even value of magical power $x$, removes it and creates a new token with magical power equal to $\frac{x}{2}$.

Tokens are more effective when their magical powers are odd values. Please help Patchouli to find the minimum number of operations she needs to make magical powers of all tokens odd values.

Input

Each test contains multiple test cases.

The first line contains a single integer $t$ ($1\le t\le {10}^{3}$) — the number of test cases. The description of the test cases follows.

For each test case, the first line contains one integer $n$ ($1\le n\le 2\cdot {10}^{5}$) — the initial number of tokens.

The second line contains $n$ intergers ${a}_{1},{a}_{2},\dots ,{a}_{n}$ ($1\le {a}_{i}\le {10}^{9}$) — the initial magical power of the $n$ tokens.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2\cdot {10}^{5}$.

Output

For each test case, print a single integer — the minimum number of operations Patchouli needs to make all tokens have an odd value of magical power.

It can be shown that under such restrictions the required sequence of operations exists.