#include using namespace std; int t,l,r,x,y,i; long long len,s; int main() { scanf("%d",&t); while (t--) { scanf("%d%d",&l,&r); for (s=0, i=1; i<=30; i++) { x=max(l,1<<(i-1)); y=min(r,(1<