from math import sqrt """ This program tries all circle placements of the given radii in the statement that are close together Comparing these with 25.4*2 we can check how much precision is required to do the comparisons correctly. """ rs = [25, 28, 32, 40, 50, 65, 80, 90, 100, 130, 160] worst=1 for dx in range(1000): for dy in range(dx,1000): for r in rs: for r2 in rs: res = sqrt(dx*dx+dy*dy)-r/2-r2/2-25.4*2 worst=min(worst,abs(res)) print(worst)