#include using namespace std; int n, q, one, two, x, y, i; long long ans; int main() { // freopen("input", "r", stdin); // freopen("output", "w", stdout); cin >> q; while(q--) { cin >> x >> y; ans = 0; for(i=0; i<30; ++i) { one = (1<