local mfl, mce = math.floor, math.ceil
local q = io.read("*n", "*l")
for iq = 1, q do
  local t1, t2, mu1, mu2, l1, l2 = io.read():
    match("(%d+)%.(%d%d) (%d+)%.(%d%d) (%d+)%.(%d%d)")
  local t = tonumber(t1) * 100 + t2
  local mu = tonumber(mu1) * 100 + mu2
  local l = tonumber(l1) * 100 + l2
  -- print(t, mu, l)
  local safe = 0
  local out = 510001
  while 1 < out - safe do
    local mid = mfl((safe + out) / 2)
    --[[
      mid/360 * t/100 + mid/360 * mid/360 / 20 / (mu/100) <= l/100
    ]]
    if 18 * mid * t * mu + 25*mid * mid <= mu * 18*360*l then
      safe = mid
    else
      out = mid
    end
  end
  if safe < 10 then
    print("0.0" .. safe)
  elseif safe < 100 then
    print("0." .. safe)
  else
    local b = string.format("%02d", safe % 100)
    print(mfl(safe / 100) .. "." .. b)
  end
end