import math import sys def main(): input = sys.stdin.read().split() m = int(input[0]) idx = 1 for _ in range(m): a = int(input[idx]) b = int(input[idx+1]) t = float(input[idx+2]) idx +=3 if a == 0: # solve (ln n)^b = t if b == 0: # impossible per problem statement pass else: exponent = t ** (1.0 / b) n = math.exp(exponent) elif b == 0: # solve n^a = t n = t ** (1.0 / a) else: # a >0 and b >0 low = 1.0 high = 1.0 # Find upper bound while True: log_high = math.log(high) f_high = (high ** a) * (log_high ** b) if f_high > t: break high *= 2 # Binary search for _ in range(100): mid = (low + high) / 2 log_mid = math.log(mid) f_mid = (mid ** a) * (log_mid ** b) if f_mid < t: low = mid else: high = mid n = high # Format the output formatted = "{0:.12f}".format(n) if '.' in formatted: formatted = formatted.rstrip('0').rstrip('.') print(formatted) if __name__ == '__main__': main()