fork download
  1. # your code goes here
  2. import math as m
  3. def solve(cx1,cy1,cx2,cy2,r1,r2):
  4. dist = m.sqrt((cx2-cx1)**2 + (cy2-cy1)**2)
  5.  
  6. if(dist==(r1+r2)) or (dist==abs(r1-r2)):
  7. return "Touching",dist
  8. elif dist<(r1+r2) or (dist<abs(r1-r2)):
  9. return "Intersecting",dist
  10. else:
  11. return "Not Touching",dist
  12.  
  13. cx1,cy1 = map(int,input().split())
  14. cx2,cy2 = map(int,input().split())
  15. r1,r2 = map(int,input().split())
  16.  
  17. ans,dist = solve(cx1,cy1,cx2,cy2,r1,r2)
  18. print(ans,dist)
  19.  
Success #stdin #stdout 0.1s 14072KB
stdin
1 1
2 1
3 1
stdout
Intersecting 1.0