import math import sys def main(): input = sys.stdin.read().split() idx = 0 m = int(input[idx]) idx += 1 results = [] for _ in range(m): a = int(input[idx]) b = int(input[idx+1]) t = float(input[idx+2]) idx +=3 if a == 0: exponent = t ** (1.0 / b) n = math.exp(exponent) elif b == 0: n = t ** (1.0 / a) else: initial_guess = t ** (1.0 / a) if initial_guess < 1.0: initial_guess = 2.0 n_current = initial_guess for _ in range(100): ln_n = math.log(n_current) f = (n_current ** a) * (ln_n ** b) - t if abs(f) < 1e-15: break term1 = a * ln_n + b if term1 == 0: break derivative = (n_current ** (a-1)) * (ln_n ** (b-1)) * term1 if derivative == 0: break n_new = n_current - f / derivative if n_new <= 0: break n_current = n_new n = n_current results.append("{0:.12f}".format(n)) print('\n'.join(results)) if __name__ == '__main__': main()