Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var xa, ya, ra, xb, yb, rb float64
		fmt.Scan(&xa, &ya, &ra, &xb, &yb, &rb)
		// println(xa, ya, ra, xb, yb, rb)
		dis := math.Sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb))
		if dis + ra < rb {
			fmt.Println(-2)
		} else if dis + rb < ra {
			fmt.Println(2)
		} else if dis > rb + ra {
			fmt.Println(0)
		} else {
			fmt.Println(1)
		}
	}
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int main(){
  int n; scanf("%d",&n);
  while(n --> 0){
    P c1, c2; double r1, r2;
    scanf("%lf%lf%lf%lf%lf%lf",&c1.real(),&c1.imag(),&r1,&c2.real(),&c2.imag(),&r2);
    double dist = abs(c1 - c2);
    if(r1 > dist + r2) puts("2");
    else if(r2 > dist + r1) puts("-2");
    else if(r1 + r2 + EPS >= dist) puts("1");
    else puts("0");
  }
  return 0;
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

struct Circle
{
	double x, y;
	double r;
};

int hit(Circle c0, Circle c1)
{
	double x = (c1.x - c0.x);
	double y = (c1.y - c0.y);

	double d = sqrt(x * x + y * y);
	if (d <= c0.r + c1.r)
	{
		if (c0.r + d < c1.r)
		{
			return -2;
		}
		else if (c1.r + d < c0.r)
		{
			return 2;
		}
		else
		{
			return 1;
		}
	}
	else
	{
		return 0;
	}
}

int main()
{
	int n;
	for (cin >> n; n--;)
	{
		Circle c0, c1;
		cin >> c0.x >> c0.y >> c0.r;
		cin >> c1.x >> c1.y >> c1.r;

		cout << hit(c0, c1) << endl;
	}
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

int main()
{
	int n;
	scanf("%d", &n);
	rep(i, n){
		double xa, ya, ra, xb, yb, rb;
		scanf("%lf%lf%lf%lf%lf%lf", &xa, &ya, &ra, &xb, &yb, &rb);

		double dist = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		if(dist > ra+rb)
			puts("0");
		else if(dist+ra < rb)
			puts("-2");
		else if(dist+rb < ra)
			puts("2");
		else
			puts("1");
	}

	return 0;
}

C++: #include<iostream>
#include<cmath>

int main() {
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++) {
		double xa, ya, ra, xb, yb, rb, dist;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		dist = std::sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (dist + rb < ra) std::cout << 2 << std::endl;
		else if (dist + ra < rb) std::cout << -2 << std::endl;
		else if (dist <= ra + rb) std::cout << 1 << std::endl;
		else std::cout << 0 << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <complex>
using namespace std;

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		float xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		complex<float> comp(xa - xb, ya -yb);
		float d = abs(comp);
		float r = ra + rb;
		if(d <= r){
			if(d < ra && rb < ra){
				cout << "2" << endl;
			}
			else if(d < rb && ra < rb){
				cout << "-2" << endl;
			}
			else{
				cout << "1" << endl;
			}
		}
		if(d > r){
			cout << "0" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rep3(var, min, max) for (ll (var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll (var) = (max) - 1; (var) + 1 > (min); --(var))
#define Mp(a,b) make_pair((a),(b))
#define F first
#define S second
#define Icin(s) ll (s);cin>>(s);
#define Scin(s) ll (s);cin>>(s);
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const double EPS=1e-10;
double add(double l, double r){
    if(abs(l+r)<EPS*(abs(l)+abs(r))) return 0;
    return l+r;
}
//l-r は add(l,-r)
//l==r は add(l,-r)==0
struct Pt{
    double x, y;
    Pt(double xx=0, double yy=0){x=xx; y=yy;}
    Pt& operator=(const Pt &rhs){
        x=rhs.x; y=rhs.y; return *this;
    }
    Pt& operator+=(const Pt &rhs){
        x = add(x,rhs.x); y = add(y,rhs.y); return *this;
    }
    Pt& operator-=(const Pt &rhs){
        x = add(x,-rhs.x); y = add(y,-rhs.y); return *this;
    }
    Pt& operator*=(const double &rhs){
        x *= rhs; y *= rhs; return *this;
    }
    Pt& operator/=(const double &rhs){
        x /= rhs; y /= rhs; return *this;
    }
};
Pt operator+(const Pt &a){return a;}
Pt operator-(const Pt &a){return Pt(-a.x,-a.y);}
Pt operator+(const Pt &lhs, const Pt &rhs){
    Pt ans=lhs; ans += rhs; return ans;
}
Pt operator-(const Pt &lhs, const Pt &rhs){
    Pt ans=lhs; ans -= rhs; return ans;
}
Pt operator*(const Pt &lhs, const double &rhs){
    Pt ans=lhs; ans *= rhs; return ans;
}
Pt operator*(const double &lhs, const Pt &rhs){
    Pt ans=rhs; ans *= lhs; return ans;
}
Pt operator/(const Pt &lhs, const double &rhs){
    Pt ans=lhs; ans /= rhs; return ans;
}
bool operator==(const Pt &lhs, const Pt &rhs){
    return add(lhs.x,-rhs.x)==0 && add(lhs.y,-rhs.y)==0;
}
bool operator!=(const Pt &lhs, const Pt &rhs){return !(lhs==rhs);}
bool operator<(const Pt &lhs, const Pt &rhs){
    return add(lhs.x,-rhs.x)!=0 ? lhs.x<rhs.x : add(lhs.y,-rhs.y)<0;
}
bool operator>(const Pt &lhs, const Pt &rhs){return rhs<lhs;}
bool operator<=(const Pt &lhs, const Pt &rhs){return !(lhs>rhs);}
bool operator>=(const Pt &lhs, const Pt &rhs){return !(lhs<rhs);}
istream& operator>>(istream &is, Pt &rhs){
    double x, y;
    is >> x >> y;
    rhs=Pt(x,y);
    return is;
}
ostream& operator<<(ostream &os, const Pt &rhs){
    os << rhs.x << " " << rhs.y;
    return os;
}
double norm(const Pt &a){return add(a.x*a.x,a.y*a.y);}
double abs(const Pt &a){return sqrt(norm(a));}
double dot(Pt a, Pt b){return add(a.x*b.x,a.y*b.y);}
double cross(Pt a, Pt b){return add(a.x*b.y,-a.y*b.x);}
int ccw(Pt a, Pt b, Pt c) {
    b -= a; c -= a;
    if(cross(b, c)>0) return +2;  // counter clockwise
    if(cross(b, c)<0) return -2;  // clockwise
    if(dot(b, c)<0) return +1;        // c--a--b on line
    if(norm(c)<norm(b)) return -1;    // b--c--a on line
    return 0;                         // a--b--c on line
}
bool judge_cross(ld ax,ld ay,ld bx,ld by,ld cx,ld cy,ld dx,ld dy){
    ld ta = (cx - dx) * (ay - cy) + (cy - dy) * (cx - ax);
    ld tb = (cx - dx) * (by - cy) + (cy - dy) * (cx - bx);
    ld tc = (ax - bx) * (cy - ay) + (ay - by) * (ax - cx);
    ld td = (ax - bx) * (dy - ay) + (ay - by) * (ax - dx);

  return tc * td < 0 && ta * tb < 0;
}
int main(){
    int n;cin>>n;
    rep(i,n){
        ld xa,ya,ra,xb,yb,rb;
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        if(sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))>ra+rb){
            cout<<0<<endl;
        }else if(sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))<ra-rb){
            cout<<2<<endl;
        }else if(sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb))<rb-ra){
            cout<<-2<<endl;
        }else{
            cout<<1<<endl;
        }
    }
}