Problem Name --Playing with bits
Topic Bitmasking
#include<bits/stdc++.h>
using namespace std;
int main() {
long q,j,count=0,temp;
std::cin>>q;
while(q–){
long a,b,count=0;
cin>>a>>b;
for(j=a;j<=b;j++){
temp = __builtin_popcount(j);
count += temp;
}
cout<<count<<endl;
}
return 0;
}