import java.io.*;
import java.util.*;
public class Main {
public static void main
(String[] args
) { Scanner in
= new Scanner
(System.
in);
short N = in.nextShort();
double r, d, h_1, a, b;
for (int i = 1; i <= N; i++){
r = in.nextDouble();
d = in.nextDouble();
h_1 = in.nextDouble();
out.print("Case " + i + ": ");
a
= Math.
asin((r
- h_1
) / r
) - Math.
asin((r
- d
) / r
); if (a == 0) out.format("%.4f%n", h_1);
else{
b
= 2 * Math.
sqrt(r
*r
- (r
- d
) * (r
- d
)) + h_1
/ Math.
sin(a
); out.
format("%.4f%n", b
* Math.
sin(a
)); }
}
out.flush();
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC4qOwoKcHVibGljIGNsYXNzIE1haW4gewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCVByaW50V3JpdGVyIG91dCA9IG5ldyBQcmludFdyaXRlcihTeXN0ZW0ub3V0KTsKCQkKCQlzaG9ydCBOID0gaW4ubmV4dFNob3J0KCk7CgkJZG91YmxlIHIsIGQsIGhfMSwgYSwgYjsKCQlmb3IgKGludCBpID0gMTsgaSA8PSBOOyBpKyspewoJCQlyID0gaW4ubmV4dERvdWJsZSgpOwoJCQlkID0gaW4ubmV4dERvdWJsZSgpOwoJCQloXzEgPSBpbi5uZXh0RG91YmxlKCk7CgkJCW91dC5wcmludCgiQ2FzZSAiICsgaSArICI6ICIpOwoJCQlhID0gTWF0aC5hc2luKChyIC0gaF8xKSAvIHIpIC0gTWF0aC5hc2luKChyIC0gZCkgLyByKTsKCQkJaWYgKGEgPT0gMCkgb3V0LmZvcm1hdCgiJS40ZiVuIiwgaF8xKTsKCQkJZWxzZXsKCQkJCWIgPSAyICogTWF0aC5zcXJ0KHIqciAtIChyIC0gZCkgKiAociAtIGQpKSArIGhfMSAvIE1hdGguc2luKGEpOwoJCQkJb3V0LmZvcm1hdCgiJS40ZiVuIiwgYiAqIE1hdGguc2luKGEpKTsKCQkJfQoJCX0KCQkKCQlvdXQuZmx1c2goKTsKCX0KfQ==