#include "bits/stdc++.h" using namespace std; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL; typedef vector vi; typedef pair pii; typedef vector > vpii; typedef long long ll; template static void amin(T &x, U y) { if(y < x) x = y; } template static void amax(T &x, U y) { if(x < y) x = y; } int main() { int T; scanf("%d", &T); rep(ii, T) { int a, b; double t; scanf("%d%d%lf", &a, &b, &t); //a log n + b log log n = log t auto logt = log(round(t * 1e4) * 1e-4L); auto x = 2.L; if(a == 0) { x = exp(pow(t * 1.L, 1.L / b)); } else if(b == 0) { x = pow(t * 1.L, 1.L / a); } else { double y = x - 1; rep(k, 20) { auto logx = log1p(y); if(abs(a * logx + b) <= 1e-13) break; auto sub = ((y + 1) * logx * (a * logx + b * log(logx) - logt)) / (a * logx + b); if(abs(sub) <= 1e-15) break; y -= sub; amax(y, 1e-13L); } x = y + 1; } printf("%.10f\n", (double)x); } return 0; }