//关系式分两个
//令x = l(H->h), 即灯泡到人的水平距离
//当x 在 [0, d - d * h / H]范围内,ans 递增有最大值为 ans = d * h / H;
//当x 在 [d - d * h / H, d]范围内,有关系式ans = H + d - (x + d * (H - h) / x);
//三分法求极值
int main() {
int t;
double h, H, d;
scanf("%d", &t);
while (t--) {
scanf("%lf %lf %lf", &H, &h, &d);
double ans = d * h / H;
double l = d - ans, r = d;
double mul = d * (H - h);
int cas = 10000;
while (cas--) {
double lmid = (2 * l + r) / 3;
double rmid = (l + 2 * r) / 3;
double ans1 = lmid + mul / lmid;
double ans2 = rmid + mul / rmid;
if (ans1 < ans2)
r = rmid;
else
l = lmid;
}
ans = max(ans, H + d - l - mul / l);
printf("%.3lf\n", ans);
}
}