import sequtils,strutils,math,strscans proc printf(formatstr: cstring) {.header: "", varargs.} var k = stdin.readline.parseInt a,b,t,n,p,q : float64 ai,bi,ti : int slope : float64 s : string kTable : array[100001,float64] n = 30.0 t = 100.0 for i in 0..50: slope = ln(n) n = n - (p - t) / slope p = n * ln(n) kTable[100000] = n for i in 1..100000: t = (100000 - i).float64 / 1000 n = kTable[100001 - i] p = (100001 - i).float64 / 1000 for l in 0..3: slope = ln(n) + 1 n -= (p - t) / slope p = n * ln(n) kTable[100000 - i] = n for i in 1..k: s = stdin.readline discard scanf(s,"$f $f $f", a, b, t) (ai,bi) = (a.int,b.int) if b == 0: n = pow(t, 1 / a) elif a == 0: n = exp(pow(t, 1 / b)) else: ti = ceil(a / b * pow(t , 1 / b) * 1000) .int p = ti.float64 / 1000 n = kTable[ti] q = a / b * pow(t , 1 / b) for l in 0..1: slope = ln(n) + 1 n = n - (p - q) / slope p = n * ln(n) n = pow(n, b / a) printf("%.11f\n",n)