#pragma GCC optimize ("O3") #pragma GCC target ("avx") #include #include #include #include #include #include #include #include #include #include #include #include #include #define getchar getchar_unlocked #define putchar putchar_unlocked #define _rep(_1, _2, _3, _4, name, ...) name #define rep2(i, n) rep3(i, 0, n) #define rep3(i, a, b) rep4(i, a, b, 1) #define rep4(i, a, b, c) for (int i = int(a); i < int(b); i += int(c)) #define rep(...) _rep(__VA_ARGS__, rep4, rep3, rep2, _)(__VA_ARGS__) using namespace std; using i8 = signed char; using i16 = signed short; using i64 = long long; using u8 = unsigned char; using u32 = unsigned; using u64 = unsigned long long; using f80 = long double; int get_int() { int c, n; while ((c = getchar()) < '0'); n = c - '0'; while ((c = getchar()) >= '0') n = n * 10 + (c - '0'); return n; } using real_t = double; double get_double() { int c, n; while ((c = getchar()) < '0'); n = c - '0'; while ((c = getchar()) >= '.') if (c != '.') n = n * 10 + (c - '0'); return n / real_t(10000.0); } real_t f(int a, int b, real_t t) { real_t res = pow(t, a); real_t lg = log(t); return res * pow(lg, b); } static vector< pair > pre[11][11]; real_t calc(int a, int b, real_t t) { if (a == 0) { assert(b > 0); return exp(pow(t, 1. / b)); } else if (b == 0) { assert(a > 0); return pow(t, 1. / a); } else { int ind = upper_bound(pre[a][b].begin(), pre[a][b].end(), make_pair(t, real_t(0))) - pre[a][b].begin() - 1; auto x = pre[a][b][ind].second; assert(pre[a][b][ind].first <= t && t < pre[a][b][ind + 1].first); rep(_, 4) { auto log_x = log(x); auto x_pow = pow(x, a - 1), logx_pow = pow(log_x, b - 1); auto numer = x_pow * logx_pow * x * log_x - t; auto denom = x_pow * logx_pow * (a * log_x + b); x -= numer / denom; } return x; } } void solve() { rep(a, 11) rep(b, 11) if (a && b) { real_t step = 0.0098765; for (real_t x = 1.0; ; x += step) { real_t y = f(a, b, x); pre[a][b].emplace_back(y, x); if (y > 10.0) break; } } int T; scanf("%d", &T); rep(_, T) { int a = get_int(), b = get_int(); auto t = get_double(); auto ans = calc(a, b, t); assert(abs(f(a, b, ans) - t) < 1e-13); printf("%.12f\n", ans); } } int main() { auto beg = clock(); solve(); auto end = clock(); fprintf(stderr, "%.3f sec\n", double(end - beg) / CLOCKS_PER_SEC); }