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<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int n; scanf("%d", &n);
	rep(i, n) {
		double x1, y1, r1, x2, y2, r2;
		scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &r1, &x2, &y2, &r2);
		double d = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
		if (d > r1 + r2)puts("0");
		else if (r1 * 2 - d >= r2 * 2)puts("2");
		else puts("1");
	}
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <complex>
#include <vector>
using namespace std;
typedef complex<double> P;

int main() {
  int Tc;
  cin >> Tc;
  while(Tc--) {
    P p1, p2;
    double r1, r2;
    cin >> p1.real() >> p1.imag() >> r1;
    cin >> p2.real() >> p2.imag() >> r2;
    double d = abs(p1-p2);
    int res;
    if(d < r1-r2) res = 2;
    else if(d < r2-r1) res = -2;
    else if(d > r1+r2) res = 0;
    else res = 1;
    cout << res << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef complex<double> P;
typedef pair<P, double> C;
#define X real()
#define Y imag()
#define EPS (1e-10)

// ??? c1 ??¨??? c2 ???????????¢???
int intersectCC(C c1, C c2){
    P c1p = c1.first, c2p = c2.first;
    double c1r = c1.second, c2r = c2.second;
    long double d = abs(c1p - c2p), r1 = c1r, r2 = c2r;
    if(r1 + r2 < d)            return  0; // ??¢????????????
    if(abs(r1 + r2 - d) < EPS) return +1; // ?????\
    if(d + r1 < r2)            return -2; // c1 ??? c2 ??????
    if(d + r2 < r1)            return +2; // c2 ??? c1 ??????
    return +1; // 2?????????????????????
}

int main() {
    C a,b;
    int n; cin >> n;
    for(int i=0; i<n; i++) {
        cin >> a.first.X >> a.first.Y >> a.second;
        cin >> b.first.X >> b.first.Y >> b.second;

        cout << intersectCC(a,b) << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;


int main()
{
  int i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      double d = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
      if(d  > (ra+rb)*(ra+rb))
	ans = 0;
      else if (d < (ra-rb)*(ra-rb) && ra>rb)
	ans = 2;
      else if (d  < (rb-ra)*(rb-ra) && rb>ra)
	ans =-2;
      else
	ans =-1;
      cout<<ans<<endl;

    }

}

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

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
		
		if(u+r2 <= r1){
			cout << "2" << endl;
		} else if(u+r1 <= r2){
			cout << "-2" << endl;
		} else if(r1+r2 >= u){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

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

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

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

#define EPS 1e-9

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

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

int main(){
  int n;
  double ax,ay,ar,bx,by,br;
  double dis;

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> ax >> ay >> ar >> bx >> by >> br;

    dis = sqrt( (ax-bx)*(ax-bx) + (ay-by)*(ay-by) );
    if( dis > ar + br)cout << 0 << endl;
    else if( br < ar && dis < ar - br)cout << 2 << endl;
    else if( ar < br && dis < br - ar)cout << -2 << endl;
    else cout << 1 << endl;
  }
}

C++: #include <iostream>
#include <cmath>
#define double long double
using namespace std;

int main()
{
	int n;
	double xa, ya, ra, xb, yb, rb;
	
	cin >> n;
	while(n--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		//B in A
		if( hypotl(xa - xb, ya - yb) + rb < ra )
			cout << 2 << endl;
		//A in B
		else if( hypotl(xa - xb, ya - yb) + ra < rb )
			cout << -2 << endl;
		//A intersect B
		else if( hypotl(xa - xb, ya - yb) < ra + rb )
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    double xa, ya, ra, xb, yb, rb, d;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = hypot(xa - xb, ya - yb);
    if (d > ra + rb)
      cout << 0;
    else if (d + rb < ra)
      cout << 2;
    else if (d + ra < rb)
      cout << -2;
    else
      cout << 1;
    cout << "\n";
  }
}

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

const double EPS = 1.0e-6;
int main(){
	int n;
	cin>>n;
	for(int num=0; num<n; num++){
		double xa, ya, ra, xb, yb, rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double dist2 = (xb-xa)*(xb-xa)+(yb-ya)*(yb-ya);
		double dist = sqrt(dist2);
		int ans;
		if(dist+ra < rb){
			ans = -2;
		} else if(dist+rb < ra){
			ans = 2;
		} else if(ra+rb < dist){
			ans = 0;
		} else {
			ans = 1;
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int n;
double x_1, y_1, r_1, x_2, y_2, r_2;

int main() {
	scanf( "%d", &n );
	for ( int i = 0; i < n; i++ ) {
		scanf( "%lf %lf %lf %lf %lf %lf", &x_1, &y_1, &r_1, &x_2, &y_2, &r_2 );
		int ans = 0;
		double _range = sqrt( sq( x_1 - x_2 ) + sq( y_1 - y_2 ) );
		if ( _range <= r_1 + r_2 - EPS) {
			ans = 1;
			if ( _range + r_1 <= r_2 - EPS ) {
				ans = -2;
			}
			else if ( _range + r_2 <= r_1 - EPS) {
				ans = 2;
			}
		}
		printf( "%d\n", ans );
	}
	return 0;
}