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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
	int N;
	cin >> N;
	for(size_t i = 0; i < N; i++)
	{
		long double xa , ya , ra , xb , yb , rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		long double l2 = ( xa - xb )*( xa - xb ) + ( ya - yb )*( ya - yb );
		if(( ra + rb )*( ra + rb ) < l2)
		{
			cout << 0 << endl;
		} else
		{
			if(l2 < ( ra - rb )*( ra - rb ) && rb < ra)
			{
				cout << 2 << endl;
			} else if(l2 < ( rb - ra )*( rb - ra ) && ra < rb)
			{
				cout << -2 << endl;
			} else
			{
				cout << 1 << endl;
			}
		}
	}
}

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

float d(float x, float y, float z, float w){
	float ret;
	ret = pow(x *1000 - z * 1000, 2) + pow(y * 1000 - w * 1000, 2);
	return sqrtf(ret);
}

int main(){
	int n;
	float x[2], y[2], r[2], dd;
	cin >> n;
	for(int i = 0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dd = d(x[0], y[0], x[1], y[1]);
		if(dd > (r[0]+r[1]) * 1000){
			cout << 0 << endl;
		}
		else if(dd + r[0] * 1000 <= r[1] * 1000){
			cout << -2 << endl;
		}
		else if (dd + r[1] * 1000 <= r[0] * 1000) {
			cout << 2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}

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

int main(){
	double xa, ya, ra, xb, yb, rb, d;
	int n;

	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
		d = sqrt(d);
		if(ra > rb){
			if(d < ra - rb) cout << "2" << endl;
			else if(d == ra - rb || d == ra + rb) cout << "1";
			else cout << "0" << endl;
		}else {
			if(d < rb - ra) cout << "-2" << endl;
			else if(d == rb - ra || d == ra + rb) cout << "1" << endl;
			else cout << "0" << endl;
		}
	}

	return 0;
}

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 + r2) puts("-2");
    else if(r1 + r2 + EPS >= dist) puts("1");
    else puts("0");
  }
  return 0;
}

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

double dist(double xa, double ya, double xb, double yb)
{
    return sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
}

int main()
{
    int n;
    std::cin >> n;

    for (int i = 0; i < n; ++i) {
        double xa, ya, ra, xb, yb, rb;
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d = dist(xa, ya, xb, yb);
        if (d > ra + rb) std::cout << "0\n";
        else {
            if (d < ra) std::cout << "2\n";
            else if (d < rb) std::cout << "-2\n";
            else std::cout << "1\n";
        }
    }
}

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

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		double xa, ya, ra;
		double xb, yb, rb;
		cin >> xa >> ya >> ra
			>>xb >> yb >> rb;
		double dis = (xb - xa) * (xb - xa) + (yb - ya) * (yb - ya);
		if(ra > rb && ((ra - rb) * (ra - rb) >= dis)){
			cout << 2 << endl;
		}else if(rb > ra && ((rb - ra) * (rb - ra) >= dis)){
			cout << -2 << endl;
		}else if(((ra + rb) * (ra + rb)) >= dis){
			cout << 1 << endl;
		}else{
			cout << 0 << 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;
      if((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)>(ra+rb)*(ra+rb))
	{
	    ans = 0;
	}
      else
	{
	  if(xa < xb+rb && xa>xb-rb && ya < yb+rb && ya>yb-rb && ra > rb)
	    ans =2;
	  else if (xb < xa+ra && xb>xa-rb && yb < ya+rb && yb>ya-rb && rb > ra)
	    ans =-2;
	  else
	    ans =-1;
	}

      cout<<ans<<endl;

    }

}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
	int n;
	cin >>n;
	for(int i=0; i<n; i++){
		double a[3],b[3],dis;
		cin >>a[0]>>a[1]>>a[2]>>b[0]>>b[1]>>b[2];
		dis = sqrt((b[0]-a[0])*(b[0]-a[0])+(b[1]-a[1])*(b[1]-a[1]));
		if(dis>a[2]+b[2]){cout <<"0"<<endl;}
		else if(dis<abs(a[2]-b[2]) && a[2]>b[2]){cout <<"2"<<endl;}
		else if(dis<abs(a[2]-b[2]) && a[2]<b[2]){cout <<"-2"<<endl;}
		else{cout <<"1"<<endl;}
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int intersection(double xa,double ya,double ra,double xb,double yb,double rb)
{
	double d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
	if(ra+rb<d)
	{
		return 0;
	}
	else if(ra+d<rb)
	{
		return -2;
	}
	else if(rb+d<ra)
	{
		return 2;
	}
	else{
		return 1;
	}
}

int main(void)
{
	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;
		cout<<intersection(xa,ya,ra,xb,yb,rb)<<endl;
	}
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  ll n,i;
  ld xa,ya,ra,xb,yb,rb;
  ld dist;

  cin>>n;
  rep(i,n){

    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    dist=sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );

    if(dist>ra+rb)
      cout<<"0"<<endl;
    else{
      if(rb<dist || ra<dist || ra==rb)
	cout<<"1"<<endl;
      else if(rb<ra && dist<ra)
	cout<<"2"<<endl;
      else if(ra<rb && dist<rb)
	cout<<"-2"<<endl;
    }
  }
}

C++: #include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y-1);(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int i,j,k,T;
  cin>>T;
  while(T--){
    double x[2],y[2],r[2],d,dx,dy;
    rep(i,2)
      cin>>x[i]>>y[i]>>r[i];
    dx=x[1]-x[0]; dy=y[1]-y[0];
    d=sqrt(dx*dx+dy*dy);
    if(d+r[0]<r[1]){
      cout<<-2<<endl;
    }else if(d+r[1]<r[0]){
      cout<<2<<endl;
    }else if(d>r[1]+r[0]){
      cout<<0<<endl;
    }else{
      cout<<1<<endl;
    }
  }
  return 0;
}