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>
using namespace std;

int main() {
	int n;
	double xa, ya, xb, yb, ra, rb;
	vector<int> Decision;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if ((ra+rb)*(ra + rb) <= (xb - xa)*(xb - xa) + (yb - ya)*(yb - ya))Decision.push_back(0);
		else if ((ra - rb)*(ra - rb) < ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) && ((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) < (ra + rb)*(ra + rb))Decision.push_back(1);
		else if ((ra - rb)*(ra - rb) > (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb)) {
			if (ra > rb)Decision.push_back(2);
			else Decision.push_back(-2);
		}
	}
	for (int i = 0; i < Decision.size(); i++)cout << Decision[i] << endl;
	return 0;
}

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

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

C++: #include <cmath>
#include <iostream>
using namespace std;
int main()
{
    int n; cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = hypot(xa-xb, ya-yb);
        int res = 1;
        if (ra > rb) {
            if (d < ra - rb) res = 2;
            else if (d > ra + rb) res = 0;
        }
        else {
            if (d < rb - ra) res = -2;
            else if (d > ra + rb) res = 0;
        }
        cout << res << 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; // 中心間距離
        d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));

        if( d > ra + rb ) cout << "0\n";
        else if( d == ra+rb ) cout << "1\n";
        else if( ra > rb ) cout << "2\n";
        else cout << "-2\n";
    }

    return 0;
}

C++: #include <cmath>
#include <iostream>
using namespace std;
int main()
{
    int n; cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = hypot(xa-xb, yb-yb);
        int res = 1;
        if (ra > rb) {
            if (d < ra - rb) res = 2;
            else if (d >= ra + rb) res = 0;
        }
        else {
            if (d < rb - ra) res = -2;
            else if (d >= ra + rb) res = 0;
        }
        cout << res << endl;
    }
    return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

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


int main(){
    int n;
    cin>>n;
    rep(loop,n){
        double x[2], y[2], r[2];
        rep(i,2)cin>>x[i]>>y[i]>>r[i];
        
        double direct = dir(x[0],y[0],x[1],y[1]);
        if(direct>r[0]+r[1])cout<<0<<endl;
        else if(direct+r[1]<=r[0])cout<<2<<endl;
        else if(direct+r[0]<=r[1])cout<<-2<<endl;
        else cout<<1<<endl;
    }
}

C++: #include <stdio.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 dis=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);   
       dis = sqrt(dis);
       if(dis>=ra+rb){
printf("%d\n",0);
continue;
}else if(dis<ra+rb && dis>fabs(ra-rb)){
printf("%d\n",1);
continue;
}else if(ra>rb){
printf("%d\n",2);
continue;
}else{
printf("%d\n",-2);
continue;
}  
}
return 0;
}

C++: #include <cstdio>
#include <complex>
#include <vector>
#include <cmath>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

typedef complex<double> P;
typedef vector<P> VP;
const double EPF = 1e-2;

#define X real()
#define Y imag()
#define EQ(x,y) (abs(x-y) < EPF)
#define LE(x,y) (x < y + EPF)
#define GE(x,y) (x + EPF > y)

double dot(P a, P b) {
  return (conj(a)*b).X;
}
double cross(P a, P b) {
  return (conj(a)*b).Y;
}
int isparallel(P a, P b, P c, P d) {//ab,cd
  return EQ(cross(a-b, c-d),0);
}
double distPP(P a, P b) {
  return sqrt(dot(a-b,a-b));
}
int relationCC(P c1, double r1, P c2, double r2) {//0..not overlap, 1..intersect, 2..2isin1, -2..1isin2
  double d = distPP(c1,c2);
  if(GE(d , r1+r2)) return 0;
  else if(GE(r1-r2,d)) return 2;
  else if(GE(r2-r1,d)) return -2;
  else return 1;
}
P intersection(P a, P b, P c, P d) {//ac , bd
  double d1 = cross(d-b,b-a);
  double d2 = cross(d-b,c-a);
  if(EQ(d1,0) & EQ(d2,0)) return a;
  if(EQ(d2,0)) return a;
  return a + (c-a)*d1/d2;
}
P normal_vector(P a) {
  P b(-a.Y, a.X);
  return b;
}
P polar(double r, double theta) {
  P a(r*cos(theta),r*sin(theta));
  return a;
}


int main() {
  int n;
  scanf("%d",&n);
  REP(i,n) {
    double x,y,r1,r2;
    scanf("%lf %lf %lf", &x, &y, &r1);
    P a(x,y);
    scanf("%lf %lf %lf", &x, &y, &r2);
    P b(x,y);
    printf("%d\n", relationCC(a,r1,b,r2));
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <cmath>
#include <set>
using namespace std;
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<n;i++)

class C{
public:
	double x;
	double y;
	double r;
};

double euc(C a,C b){
	a.x -= b.x;
	a.y -= b.y;
	return sqrt(a.x*a.x+a.y*a.y);
}

int main(){
	int n;
	C a,b;
	cin >> n;
	while(n--){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
		
		if( euc(a,b)+b.r <= a.r && a.r > b.r ){
			cout << 2 << endl;
		}else if( euc(a,b)+a.r <= b.r && b.r > a.r ){
			cout << -2 << endl;
		}else if(euc(a,b)-b.r < a.r || euc(a,b)-a.r < b.r){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define drep(n,m) for(int i=0;i<n;i++)for(int j=0;j<m;j++)
#define fi first
#define se second
#define vi vector<int>
#define INF 1000000000
#define MOD 1000000009
#define pb push_back
#define mp make_pair
typedef long long ll;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

ll gcd(ll a,ll b){
    if(a<b){
        int t=a;a=b;b=t;
    }
    int c=a%b;
    while(c!=0){
        a=b;
        b=c;
        c=a%b;
    }
    return b;
}

ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}

bool isPrime(int x){
    if(x==1)return false;
    if(x==2)return true;
    if(x%2==0)return false;
    for(int i=3;i<=sqrt(x);i+=2){
        if(x%i==0)return false;
    }
    return true;
}

int main() {
    int n;
    cin>>n;
    rep(i,0,n){
    double x,y,r,xx,yy,rr;
    cin>>x>>y>>r>>xx>>yy>>rr;
    double diff=sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
     if(diff>r+rr)cout<<0<<endl;
     else if(diff<rr-r)cout<<-2<<endl;
     else if(diff<r-rr)cout<<2<<endl;
     else cout<<1<<endl;
    
    }
    
  
    return 0;
}