Description Duoduo has a sequence of positive integers, which supports two operations:…
- User
Description
Duoduo has a sequence of positive integers, which supports two operations: Select an even number and halve its value. Select two numbers, remove and replace them with the sum of the two numbers Duoduo hopes to get a sequence of all odd numbers. Please calculate the minimum number of operations required
Input description
The first line is a number T, representing the number of test case groups () For each test case: The first line is n, representing the length of the array, (0<n<10^5) The second line is n positive integers, ai, (0<ai<10^14)
Output description
For each test case, output a number, representing the minimum number of operations required
Input
2 1 4 2 4 8
Output
2 3
Please use python code to solve it
- Assistant