import strutils, sequtils, math, strscans proc scanf(frmt: cstring) {.varargs, importc, header: "".} proc printf(formatstr: cstring) {.header: "", importc: "printf", varargs.} proc f(n, a, b : float64): float64 {.inline.} = pow(n, a) * pow(ln(n), b) when isMainModule: var m: int a, b, t: float64 scanf("%ld", addr m) for i in 0..m-1: scanf("%lf %lf %lf", addr a, addr b, addr t) var l = 0.0 r = 1000000000.0 for p in 1..100: var mid = (l + r) / 2 if f(mid, a, b) <= t: l = mid else: r = mid printf("%.11f\n", r)