Case = int(input())
for _ in range(Case):
    x_1, y_1, r_1, x_2, y_2, r_2 = list(map(int, input().split()))
    d = ((x_1 - x_2) ** 2) + ((y_1 - y_2) ** 2)
    # d에 제곱근을 씌우지 않았기 때문에 단위를 맞추기 위해 
    # 비교에 주로 사용될 sum, diff를 선언하여 제곱시켜줍니다.
    r_sum = (r_1 + r_2) ** 2
    r_diff = (r_1 - r_2) ** 2

    # 좌표가 같은 경우
    if(d == 0):
        # 원이 겹칠때
        if(r_1 == r_2):
            print(-1)
        # 한 원이 다른 원을 포함하고 있는 경우
        else:
            print(0)
    # 좌표가 달라 원이 서로 떨어져 있는 경우
    else:
        # 한점만 겹치는 경우
        if((d == r_sum) or (d == r_diff)):
            print(1)
        # 겹치는 점이 2개인 경우
        elif((d < r_sum) and (d > r_diff)):
            print(2)
        # 아예 떨어져 있는 경우
        else:
            print(0)

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 2231번(python)  (0) 2019.07.07
백준 2798번(python)  (0) 2019.07.06
백준 3053번(python)  (0) 2019.07.05
백준 4153번(python)  (0) 2019.07.05
백준 3009번(python)  (0) 2019.07.05


# 문제에선 소수점 6자리까지 출력이 되어있지만 그럴경우 메모리 초과가 뜬다
# 4로 줄이니까 맞았습니다.
r = int(input())
import math
print('%.4f' % (math.pi * r * r))
print('%.4f' % (r * r * 2))

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 2798번(python)  (0) 2019.07.06
백준 1002번(python)  (0) 2019.07.05
백준 4153번(python)  (0) 2019.07.05
백준 3009번(python)  (0) 2019.07.05
백준 1085번(python)  (0) 2019.07.05


while(True):
    num_list = list(map(int, input().split()))
    if(sum(num_list) == 0):
        break
    
    hypo = max(num_list); num_list.remove(hypo)
    num = sum(list(map(lambda x : x ** 2, num_list)))
    if((hypo ** 2) == num):
        print('right')
    else:
        print('wrong')

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 1002번(python)  (0) 2019.07.05
백준 3053번(python)  (0) 2019.07.05
백준 3009번(python)  (0) 2019.07.05
백준 1085번(python)  (0) 2019.07.05
백준 2869번(python)  (0) 2019.07.04


x_points = []
y_points = []
for _ in range(3):
    x, y = list(map(int, input().split()))
    x_points.append(x)
    y_points.append(y)
    
point_x = x_points[2] if x_points[0] == x_points [1] else (x_points[1] if x_points[0] == x_points[2] else x_points[0])
point_y = y_points[2] if y_points[0] == y_points [1] else (y_points[1] if y_points[0] == y_points[2] else y_points[0])
print('{} {}'.format(point_x, point_y))

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 3053번(python)  (0) 2019.07.05
백준 4153번(python)  (0) 2019.07.05
백준 1085번(python)  (0) 2019.07.05
백준 2869번(python)  (0) 2019.07.04
백준 1712번(python)  (0) 2019.07.03


# 이 문제에서 얻어가야 할 것은
# 직사각형은 경계선까지의 거리 고려에서 대각선이 최소인 경우가 없으므로
# 대각선은 고려하지 않아야합니다.
# x, y를 함께 min 고려해주는 이유는 x, y좌표를 기준으로 w, h까지의 거리와
# (0, 0)까지의 거리를 고려해야하기 때문입니다.
# 예시 = (1 2 5 4) 이면 답은 1이어야 합니다.
x, y, w, h = list(map(int, input().split()))
print(min([x, y, w - x, h - y]))

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 4153번(python)  (0) 2019.07.05
백준 3009번(python)  (0) 2019.07.05
백준 2869번(python)  (0) 2019.07.04
백준 1712번(python)  (0) 2019.07.03
백준 3052번(python)  (0) 2019.07.03