题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5984
#include<bits/stdc++.h>
using namespace std;
#define debug puts("YES");
#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)
#define read(x,y) scanf("%d%d",&x,&y)
#define ll long long
#define lrt int l,int r,int rt
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define root l,r,rt
const int maxn =2e3+5;
const int mod=1e9+7;
const int ub=1e6;
ll powmod(ll x,ll y){ll t; for(t=1;y;y>>=1,x=x*x%mod) if(y&1) t=t*x%mod; return t;}
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*
题目大意:给定一段绳子和其初始长度,再给定一个限定长度为D,
随机剪断并舍弃左边的长度直至手中的长度小于D,
问减绳子的期望次数。
f(x)=积分:0-L/b f'(t) dt/(L/b)+1,
解出来f(x)=ln(x)+1,其中x代换的是L/b,
*/
double a,b;
int main()
{
int t;scanf("%d",&t);
while(t--)
{
scanf("%lf%lf",&a,&b);
double ans=0;
if(a>b) ans=log(a/b)+1;
printf("%.6f\n",ans);
}
return 0;
}