Division solution codechef
Chef has an integer. He repeats the following operation until becomes .
- Chef chooses an integer such that and is a divisor of and then divides by (the new value of becomes ). If is even, Chef gets points otherwise he gets points
Can you find the maximum points Chef can get if he performs the operations optimally?
Input Format Division solution codechef
- First line will contain , number of testcases. Then the testcases follow.
- Each testcase contains of a single line of input containing three integers .
Output Format Division solution codechef
For each testcase, output in a single line the maximum points Chef can get.
Constraints Division solution codechef
Sample Input 1 Division solution codechef
4 10 2 3 15 5 -2 12 2 3 8 -1 0
Sample Output 1 Division solution codechef
5 -2 7 -1
Test case: First Chef divides by and gets points and then divides by and thus gets points. Hence Chef gets a total of points.
Test case: Chef divides by . Hence he gets points.