import strutils, sequtils, math, strscans {.checks: off, optimization: speed.} 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) type Array = array[0..11*11*10001, float64] when isMainModule: var m, a, b: int t: float64 scanf("%ld", addr m) var x : Array for i in 0..10: for j in 0..10: for k in 0..10000: var (l, r) = (0.0, 1000000000.0) for p in 1..64: var mid = (l + r) / 2 if f(mid, i.float64, j.float64) <= k.float64 / 1000: l = mid else: r = mid x[i+11*j+11*11*k] = r for i in 0..m-1: scanf("%d %d %lf", addr a, addr b, addr t) printf("%.11f\n", x[a+b*11+11*11*(t*1000).int])