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;

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

istream &operator >> (istream &is, Circle &c)
{
    return is >> c.x >> c.y >> c.r;
}

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

int main()
{
    int N;    
    Circle c1, c2;
    cin >> N;
    while (N--) {
        cin >> c1 >> c2;
        double d = dist(c1.x, c1.y, c2.x, c2.y);
        if (c1.r + c2.r < d) {
            cout << 0 << endl;
        } else if (c2.r + d < c1.r) {
            cout << 2 << endl;
        } else if (c1.r + d < c2.r) {
            cout << -2 << endl;
        } else {
            cout << 1 << endl;
        }
    }    
    return 0;
}

C++: #include<iostream>
#include<vector>
#include<cmath>
using namespace std;
struct circle {
	double x;
	double y;
	double r;
};
int main() {
	enum ins{A_isin_B,B_isin_A,Intersect,isnot};
	vector<ins>l;
	circle c1, c2;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> c1.x >> c1.y >> c1.r >> c2.x >> c2.y >> c2.r;
		double dis = sqrt((c2.x - c1.x)*(c2.x - c1.x) + (c2.y - c1.y)*(c2.y - c1.y));
		if (c1.r + c2.r < dis)l.push_back(isnot);
		else if (dis + c1.r <= c2.r)l.push_back(A_isin_B);
		else if (dis + c2.r <= c1.r)l.push_back(B_isin_A);
		else l.push_back(Intersect);
	}
	for (ins i : l) {
		if (i == A_isin_B)cout << -2;
		else if (i == B_isin_A)cout << 2;
		else if (i == isnot)cout << 0;
		else cout << 1;
		cout << endl;
	}
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<math.h>

int main(){
	int n,i;
	double xa,ya,ra,xb,yb,rb;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
		double d=sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
		if(d>ra+rb)printf("0\n");
		else if(d>abs(ra-rb))printf("1\n");
		else{
			if(ra>rb)printf("2\n");
			if(ra<rb)printf("-2\n");
		}
	}
	return 0;
}

C++: #include <stdio.h>
struct circle{
    long double x;
    long double y;
    long double r;
};
long double abs(long double a){
    if(a<0)return -a;
    return a;
}
long double range(circle a,circle b){
    return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
}
int main(){
    int n;
    circle a[2];
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        for(int j=0;j<2;j++)scanf("%Lf%Lf%Lf",&a[j].x,&a[j].y,&a[j].r);
        if((a[0].r+a[1].r)*(a[0].r+a[1].r)<range(a[0],a[1])){
            printf("0\n");
        }
        else if(range(a[0],a[1])>=abs(a[0].r-a[1].r)*abs(a[0].r-a[1].r)&&range(a[0],a[1])<=(a[0].r+a[1].r)*(a[0].r+a[1].r)){
            printf("1\n");
        }
        else{
            if(a[0].r>a[1].r)printf("2\n");
            else printf("-2\n");
        }
    }
}

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((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 (d < ra+rb) cout << 1 << endl;
    else cout << 0 << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
int main(){
    pdd a,b; double ar,br; int n;
    cin>>n;
    rep(i,n){
        cin>>a.first>>a.second>>ar>>b.first>>b.second>>br;
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar))return puts("-2")*0;
        swap(a,b); swap(ar,br);
        if((b.first-br<a.first-ar)&&(a.first+ar<b.first+br)//x
           &&(b.second+br>a.second+ar)&&(b.second-br<a.second-ar))return puts("2")*0;
        swap(a,b); swap(ar,br);
        if(abs(a.first-b.first)<=2*(ar+br)||abs(a.first-b.first)==min(ar,br))return puts("1")*0;
        else puts("0");
        
    }
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
double pitagoras(double x1,double y1,double x2,double y2){
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

main(){
  int n;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    double xa,ya,ra,xb,yb,rb;
    scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
    double r=pitagoras(xa,ya,xb,yb);
    if(r+ra <= rb) printf("-2\n");
    else if(r+rb <= ra) printf("2\n");
    else if(ra+rb >= r) printf("1\n");
    else printf("0\n");
  }
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define MAX_N 5001
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<string, ll> PS;
typedef vector<ll> V;

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;


double xa, ya, ra, xb, yb, rb, d;
ll n;

int main(){
	cin >> n;
	REP(i, n){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

		if (xa == xb&&ya == yb) d = 0;
		else d = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));

		if (ra + rb < d)cout << 0 << endl;
		else if (d + ra < rb)cout << -2 << endl;
		else if (d + rb < ra)cout << 2 << endl;
		else cout << 1 << endl;
	}
}