import sequtils,strutils,osproc;const p = @[ """echo '{.experimental.} import sequtils,strutils,algorithm,math,future,macros template get*():string = stdin.readLine().strip() macro unpack*(arr: auto,cnt: static[int]): auto = let t = genSym(); result = quote do:(let `t` = `arr`;()) for i in 0.. 1600 ms (parallel::3003ms... -> 1705ms) proc printf(formatstr: cstring){.header: "", varargs.} proc scanf(formatstr: cstring){.header: "", varargs.} proc scan3f():seq[float] = var a,b,c : float scanf("%lf%lf%lf",addr a,addr b,addr c) return @[a,b,c].mapIt(it) let M = get().parseInt() ABT = newSeqWith(M,scan3f()) var ans = newSeq[float](M) proc solve(m:int) = let (a,b,t) = ABT[m].unpack(3) proc newton(a,b,t:float): float = result = 1.1 var lnx = ln(result) for i in 1..25: result -= (a*lnx + b*lnx.ln - t.ln) / ((a*lnx + b) / (result*lnx)) lnx = result.ln ans[m] = if a == 0: exp(pow(t, 1.0/b)) elif b == 0: pow(t, 1.0/a) else: newton(a,b,t) template parallelDo(fn:int->void ,MIN,MAX:int) = # do fn(i) parallel :: i in [MIN.. h.nim""","nim --hints:off -o:b.out -d:release --threads:on --experimental --parallelBuild:4 c h.nim"].mapIt(it.gorge) discard execProcess("""a="$(ls -1t ../time/ | head -1)";./b.out < ../test_in/$a > ../out/$a""")