fabs py

Run Settings
LanguagePython
Language Version
Run Command
import math t = int(input()) for i in range(t): x, y, c = map(float, input().split()) left = 0 right = min(x, y) d = (left + right) / 2 while True: a = math.sqrt(x * x - d * d) b = math.sqrt(y * y - d * d) c1 = 1 / ( 1 /a + 1 / b) if c1 < c: right = (left + right) / 2 else: left = (left + right) / 2 d = (left + right) / 2 if not math.fabs(c1 - c) > 0.00001: break #print("{:.3f}".format(d)) print('%.3f' % d)
Editor Settings
Theme
Key bindings
Full width
Lines