#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
    int n;
    double a,b;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%lf%lf",&a,&b);
        printf("%.6lf\n",a<=b?0:log(a/b)+1);
    }
    return 0;
}
