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++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  double x[2], y[2], r[2];
  rep(i, n){
    rep(j, 2){
      cin >> x[j] >> y[j] >> r[j];
    }
    double dis = sqrt((x[1] - x[0]) * (x[1] - x[0]) + (y[1] - y[0]) * (y[1] - y[0]));
    if(dis > r[0] + r[1])cout << 0 << endl;
    else if(abs(r[0] - r[1]) <= dis){
      cout << 1 << endl;
    }else{
      if(r[0] > r[1]){
        cout << 2 << endl;
      }else{
        cout << - 2 << endl;
      }
    }
  }
	return 0;
}

C++: #include <iostream>
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 = (xb - xa) * (xb - xa) + (yb - ya) * (yb - ya);
		if (d < rb - ra){
			cout << -2 << endl;
		}
		else if (d < ra - rb){
			cout << 2 << endl;
		}
		else if (d > ra + rb){
			cout << 0 << endl;
		}
		else{
			cout << 1 << 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 ) {
			ans = 1;
			if ( _range + r_1 <= r_2 ) {
				ans = -2;
			}
			else if ( _range + r_2 <= r_1 ) {
				ans = 2;
			}
		}
		printf( "%d\n", ans );
	}
	return 0;
}

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

typedef pair<double,double>vec;

double norm(vec v1,vec v2){
    return (v1.first-v2.first)*(v1.first-v2.first)+(v1.second-v2.second)*(v1.second-v2.second);
}
int main()
{
    int n;
    cin>>n;
    while(n--){
        double x1,y1,r1,x2,y2,r2;
        cin>>x1>>y1>>r1>>x2>>y2>>r2;
        vec v1=make_pair(x1,y1);
        vec v2=make_pair(x2,y2);
        double dis=norm(v1,v2);
        if(dis-(r1+r2)*(r1+r2)>0)
            cout<<0<<endl;
        else if(dis-(r1-r2)*(r1-r2)>0&&dis-(r1+r2)*(r1+r2)<0){
            cout<<1<<endl;
        }
        else if((r1-r2)>0){
            cout<<2<<endl;
        }
        else cout<<-2<<endl;
    }
    return 0;
}

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

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(i, n) REP (i, 0, n)
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;

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

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


using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		double x[2], y[2], r[2];
		for (int j = 0; j < 2; ++j)
			scanf("%lf %lf %lf", x+j, y+j, r+j);
		double d = sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1]));
		if (d > r[0]+r[1])
			puts("0");
		else if (r[0]-d > r[1])
			puts("2");
		else if (r[1]-d > r[0])
			puts("-2");
		else
			puts("1");
	}

	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

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 ab = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (ab + rb - ra <= EPS) cout << 2 << endl;
		else if (ab + ra - rb <= EPS) cout << -2 << endl;
		else if (ab - ra - rb <= 0) cout << 1 << endl;
		else cout << 0 << endl;
	}
	return 0;
}

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

int main(void){
  int N; cin >> N;
  while(N--){
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    if(pow(xa - xb, 2) + pow(ya - yb, 2) > pow(ra + rb, 2)){
      cout  << 0 << endl;
      continue;
    }

    

    if(sqrt(pow(xa - xb, 2) + pow(ya - yb, 2)) + rb < ra){
      cout << 2 << endl;
      continue;
    }
    if(sqrt(pow(xa - xb, 2) + pow(ya - yb, 2)) + ra < rb){
      cout << -2 << endl;
      continue;
    }
    cout << 1 << endl;
  }  

  return 0;
}