Go: package main

import (
        "fmt"
        "math"
)

func main() {
        var n int
        fmt.Scanf("%d", &n)
        for i := 0; i < n; i++ {
                var ax, ay, ar, bx, by, br float64
                fmt.Scanf("%f %f %f %f %f %f", &ax, &ay, &ar, &bx, &by, &br)

                d := math.Sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay))
                if d <= ar + br {
                        if ar > br {
                                if ar > br + d {
                                        fmt.Println("2")
                                } else {
                                        fmt.Println("1")
                                }
                        } else {
                                if br > ar + d {
                                        fmt.Println("-2")
                                } else {
                                        fmt.Println("1")
                                }
                        }
                } else {
                        fmt.Println(0)
                }
        }
}

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

int main(){
  int q;
  cin>>q;
  while(q--){
    double xa,ya,ra,xb,yb,rb;
    cin>>xa>>ya>>ra>>xb>>yb>>rb;

    int f=-1; 
    if(ra>rb) f=1,swap(ra,rb),swap(xa,xb),swap(ya,yb);
    double dis=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
 
    if(dis>ra+rb) cout << 0<<endl;
    else if(dis+ra<rb)cout << f*2<<endl;
    else cout << 1<<endl;
  }
  return 0;
}

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

double dist(double x1, double y1, double x2, double y2);

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

double dist(double x1, double y1, double x2, double y2){
    return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}

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

inline double distance(double xa, double ya, double xb, double yb){
	return std::sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
}

int judge(std::vector<double> ve){
	double center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	if(center_dis > ve[2] + ve[5]){
		return 0;	
	}else if(ve[2] >= center_dis + ve[5]){
		return 2;
	}else if(ve[5] >= center_dis + ve[2]){
		return -2;
	}else{
		return 1;
	}
}

int main(void){
	int num;
	std::vector<double> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}

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

using namespace std;

int main(){
  int n;
  cin >> n;
  while(n--){
    complex<double> c1,c2;
    double r1,r2,dist;
    cin >> c1.real() >> c1.imag() >> r1 >> c2.real() >> c2.imag() >> r2;
    dist = abs(c1-c2);
    if(dist>r1+r2){
      cout << 0 << endl;
    }else if(dist>abs(r1-r2)){
      cout << 1 << endl;
    }else if(r1>r2){
      cout << 2 << endl;
    }else{
      cout << -2 << endl;
    }
  }
}

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

int main(){
	int N;
	std::cin >> N;
	
	std::array<int, 20> ans;
	
	for(int i=0; i<N; ++i){
		double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		double d = pow((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb), 0.5);
		
		if(ra > rb && d <= ra-rb) ans[i] = 2;
		else if(rb > ra && d <= rb-ra) ans[i] = -2;
		else if(d <= ra+rb) ans[i] = 1;
		else if(d > ra+rb) ans[i] = 0;
	}
	
	for(int i=0; i<N; ++i)
		std::cout << ans[i] << std::endl;
	
	return 0;
}

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 <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <complex>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;

#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class T> void preview(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}

const int INF = 100000000;
const double PI = acos(-1.0), EPS = 1e-10;

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

bool EQ(double x, double y) {
	return fabs(x - y) <= EPS;
}

int main() {
	int N; cin >> N;
	rep(n,N) {
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dist = distance(xa, ya, xb, yb);
		if(dist + rb < ra) {
			cout << 2 << endl;
			continue;
		}
		if(dist + ra < rb) {
			cout << -2 << endl;
			continue;
		}
		if(dist > ra + rb) {
			cout << 0 << endl;
			continue;
		}
		// if(EQ(dist, ra + rb)) {
			cout << 1 << endl;
			continue;
		// } 

	}
	return 0;
}

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

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

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

#define reps(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) reps(v, 0, n)
#define lep(v, n) reps(v, 1, n + 1)
#define rreps(v, f, l) for (int v = (l), v##_ = (f); v >= v##_; --v)
#define rrep(v, n) rreps(v, 0, n - 1)
#define rlep(v, n) rreps(v, 1, n)
#define show_a(a, size) rep(a##_it, size) std::cout << a[a##_it] << " \n"[a##_it == a##_it_ - 1];
#define show_v(v) show_a(v, v.size())
#define debug(x) std::cerr << #x << " = " << (x) << "\n";

using namespace std;

typedef long long int lint;
typedef complex<double> P;

const double EPS = 1e-15;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

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