fork download
  1. import math
  2. import sys
  3. a=int(sys.stdin.readline())
  4. for i in range(a):
  5. x1,y1,r1,x2,y2,r2=map(float,sys.stdin.readline().split())
  6. d=math.sqrt(((x2-x1)**2)+((y2-y1)**2)) #두 중심사이의 거리
  7. if x1==x2 and y1==y2:#원의 중심이 같을때
  8. if r1==r2:
  9. print(-1)
  10. else:
  11. print(0)
  12. elif d==r1 or d==r2: #원이 내접할때
  13. print(1)
  14. else: #원의 중심이 다를때
  15. if r1+r2==d: #외접할때
  16. print(1)
  17. elif r1+r2>d:
  18. print(2)
  19. else:
  20. print(0)
Success #stdin #stdout 0.02s 9252KB
stdin
1
0 0 1 1 1 9999
stdout
2