// {{{ Templates #include #define show(x) cerr << #x << " = " << x << endl using namespace std; using ll = long long; using pii = pair; using vi = vector; template ostream& operator<<(ostream& os, const vector& v) { os << "sz:" << v.size() << "\n["; for (const auto& p : v) { os << p << ","; } os << "]\n"; return os; } template ostream& operator<<(ostream& os, const pair& p) { os << "(" << p.first << "," << p.second << ")"; return os; } constexpr ll MOD = (ll)1e9 + 7LL; template constexpr T INF = numeric_limits::max() / 100; // }}} constexpr long double EPS = 1e-10; inline long double bin(const ll a, const ll b, const long double t) { const long double lgt = log(t); long double inf = -1.0; long double sup = 11.0; // while (sup > inf) { for (int i = 0; i < 52; i++) { const long double mid = (inf + sup) / 2; const long double c = a * mid + b * log(mid); // if (abs(c - lgt) < EPS) { // break; // } if (c < lgt) { inf = mid; } else { sup = mid; } } return exp(inf); } inline long double newton(const ll a, const ll b, const long double t) { long double x = 4.0; while (true) { show(x); const long double cal = a * x + b * log(x) - log(t); if (abs(cal) < EPS) { break; } x -= cal / (a + b / x); } return exp(x); } int main() { cin.tie(0); ios::sync_with_stdio(false); ll m; cin >> m; for (ll i = 0; i < m; i++) { ll a, b; cin >> a >> b; long double t; cin >> t; cout << fixed << setprecision(12) << bin(a, b, t) << "\n"; // cout << fixed << setprecision(12) << newton(a, b, t) << "\n"; } return 0; }