Skip to content

Instantly share code, notes, and snippets.

@pignuante
Created December 8, 2020 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pignuante/5f7930e3e204850f02522e166040c375 to your computer and use it in GitHub Desktop.
Save pignuante/5f7930e3e204850f02522e166040c375 to your computer and use it in GitHub Desktop.
T = int(input())
for _ in range(T):
x1, y1, r1, x2, y2, r2 = list(map(int, input().split()))
dist = (x2-x1) * (x2-x1)+(y2-y1) * (y2-y1)
rd = (r2-r1) * (r2-r1)
rs = (r2+r1) * (r2+r1)
C = "0"
if dist == 0 and rd == 0:
C = "-1"
else:
if dist in (rd, rs):
C = "1"
elif rd < dist < rs:
C = "2"
print(C)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment