Getting No output

Why is my code is not showing any output
ide’s code link- https://ide.codingblocks.com/s/194105

P.S.- i sometimes stuck in such situations in which my code compiles successfully but it doesn’t show any output. I recheck my code but there is no error. So why is that?

@SATVIK it is stuck in infinite loop. In popcount function.

@SATVIK For even cases a is not reduced.

but still its not giving the right output
ide- https://ide.codingblocks.com/s/196200

@SATVIK What problem are you facing now?

output for all the the testcases is coming out as -1

@SATVI Do a few things before you proceed.
1.Include bits/stdc++.h into your program.
2. Use builtin_popcountll(n) fo counting no of ones.
3. Check your else part in main function. You are reducing your ans there.