#include <bits/stdc++.h>
using namespace std;
#define file(name) if (fopen(name".INP", "r")){freopen(name".INP", "r", stdin); freopen(name".OUT", "w", stdout);}
int sqr(int x){return x*x;}
int power(int x, int y){
if (y == 0) return 1;
if (y % 2 == 0) return sqr(power(x, y/2));
else return x*sqr(power(x, y/2));
}
void solution(){
int a, b;
cin >> a >> b;
int year = 0;
while (a * power(3, year) <= b * power(2, year)) year++;
cout << year << "\n";
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
file("TEST");
int test; cin >> test;
while (test --> 0) solution();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGZpbGUobmFtZSkgaWYgKGZvcGVuKG5hbWUiLklOUCIsICJyIikpe2ZyZW9wZW4obmFtZSIuSU5QIiwgInIiLCBzdGRpbik7IGZyZW9wZW4obmFtZSIuT1VUIiwgInciLCBzdGRvdXQpO30KCmludCBzcXIoaW50IHgpe3JldHVybiB4Kng7fQoKaW50IHBvd2VyKGludCB4LCBpbnQgeSl7CglpZiAoeSA9PSAwKSByZXR1cm4gMTsKCWlmICh5ICUgMiA9PSAwKSByZXR1cm4gc3FyKHBvd2VyKHgsIHkvMikpOwoJZWxzZSByZXR1cm4geCpzcXIocG93ZXIoeCwgeS8yKSk7Cn0KCnZvaWQgc29sdXRpb24oKXsKCglpbnQgYSwgYjsKCWNpbiA+PiBhID4+IGI7CglpbnQgeWVhciA9IDA7Cgl3aGlsZSAoYSAqIHBvd2VyKDMsIHllYXIpIDw9IGIgKiBwb3dlcigyLCB5ZWFyKSkgeWVhcisrOwoJY291dCA8PCB5ZWFyIDw8ICJcbiI7CgkKfQoKc2lnbmVkIG1haW4oKXsKCWlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCk7CgljaW4udGllKDApOyBjb3V0LnRpZSgwKTsKCglmaWxlKCJURVNUIik7CgoJaW50IHRlc3Q7IGNpbiA+PiB0ZXN0OwoJd2hpbGUgKHRlc3QgLS0+IDApIHNvbHV0aW9uKCk7CgkKCXJldHVybiAwOwp9