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) var x = newSeqWith(11, newSeqWith(11, newSeq[float64](1001))) var max = 0.0 for i in 0..10: for j in 0..10: for k in 0..1000: var (l, r) = (0.0, 10000000.0) for p in 1..64: var mid = (l + r) / 2 if f(mid, i.float64, j.float64) <= k.float64 / 100: l = mid else: r = mid x[i][j][k] = r for i in 0..m-1: scanf("%lf %lf %lf", addr a, addr b, addr t) printf("%.11f\n", x[a.int][b.int][(t*100).int])