import strutils, sequtils, math, strscans 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 input = stdin.readLine a, b, t, l, r: float64 discard input.scanf("$i", m) var memo = newSeq[float64](100001) for i in 0..m-1: (l, r) = (0.0, 1000000000.0) input = stdin.readLine discard input.scanf("$f $f $f", a, b, t) for i in 1..64: var mid = (l + r) / 2 if f(mid, a, b) <= t: l = mid else: r = mid printf("%.11f\n", r)