/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>

typedef long long LL;
using namespace std;

int n;
double a, b;

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);

	scanf("%d", &n);
	for (int i = 1; i <= n; i++){
		scanf("%lf %lf", &a, &b);
		if(a <= b){
			printf("0.000000\n");
		}else{
			printf("%.6lf\n", 1 + log(a / b));
		}
		
	}

	return 0;
}
/**/