import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.math; // math functions import std.typecons; // Tuple, Nullable, BigFlags void main() { auto m = readln.chomp.to!int; foreach (_; 0..m) { auto rd = readln.splitter; auto a = rd.front.to!real; rd.popFront(); auto b = rd.front.to!real; rd.popFront(); auto t = rd.front.to!real; if (b == 0) { writefln("%.10f", t ^^ (1.0L/a)); continue; } else if (a == 0) { writefln("%.10f", E ^^ (t ^^ (1.0L/b))); continue; } auto r = a / b * t ^^ (1.0L / b); auto calc(real x) { return x * log(x); } auto eps = 0, mi = eps, ma = 100; auto bsearch = iota(mi, ma, 1.0e-10L).map!(n => tuple(n, calc(n))).assumeSorted!"a[1] < b[1]"; auto x = bsearch.lowerBound(tuple(0, r)).back[0] + eps; writefln("%.10f", x ^^ (b/a)); } }