import streams, deques, sequtils, strutils, algorithm, math, future, sets, tables, hashes proc `ceilDiv`*[T](x, y: T): T = x div y + ord(x mod y != 0) proc `//=`*(x: var SomeInteger; y: SomeInteger) = x = x div y proc `%=`*(x: var SomeInteger; y: SomeInteger) = x = x mod y var L = stdin.readLine.split.map(parseFloat) P = L[0] Q = L[1] ldx = 0.0.float64 rdx = float(10^12).float64 mid = ((rdx + ldx) / 2).float64 while rdx - ldx > 0.00001: mid = (rdx + ldx) / 2 if mid^2 <= Q * mid * log2(mid) + P: ldx = mid elif mid^2 > Q * mid * log2(mid) + P: rdx = mid # echo mid echo mid