注意n最大取
#include<iostream>
#define endl '\n'
using namespace std;
void solve(long long x) {
int cnt = 0, sum = 0;
while (x) {
cnt += x & 1;
sum++;
x >>= 1;
}
cout << sum-cnt << endl;
}
int main() {
int t;
long long n;
cin >> t;
while (t--) {
cin >> n;
solve(n);
}
return 0;
}
1e18,