Baekjoon Case

[파이썬 / 백준 1002번] 터렛

Scarlett_C 2021. 11. 17. 13:02
728x90

https://www.acmicpc.net/problem/1002

728x90
t=int(input())
for i in range(t):
    x1,y1,r1,x2,y2,r2=map(int,input().split())
    dist=((x2-x1)**2+(y2-y1)**2)**0.5
    if x1==x2 and y1==y2:
        if r1==r2:
            print(-1)
        else: print(0)
    else:
        if r1>dist+r2 or r2>dist+r1 or dist>r1+r2:
            print(0)
        elif r1==dist+r2 or r2==dist+r1 or r1+r2==dist:
            print(1)
        else: print(2)
728x90