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<iostream>
#include<string>

using namespace std;
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;
       
        double d;
         d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
        
        int ans;
         d<ra-rb ? ans=2 : d<rb-ra ? ans=-2 : d<=ra+rb ? ans=1 : ans=0;
         cout<<ans<<endl;
	}


	return 0;
}

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

int main(){
  int n,cnt=0;
  double xa,ya,ra,xb,yb,rb;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    if(xa+1*ra>=xb+1*rb) cnt++;
    if(ya+1*ra>=yb+1*rb) cnt++;
    if(xa+-1*ra<=xb+-1*rb) cnt++;
    if(ya+-1*ra<=yb+-1*rb) cnt++;
 


    if(xa+1*ra<xb-1*rb || ya+1*ra<yb-1*ra) cout<<0<<endl;
    else if(xa-1*ra>xb+1*rb || ya-1*ra>yb+1*ra) cout<<0<<endl;
    else if(cnt==4) cout<<2<<endl;
    else if(cnt==0) cout<<-2<<endl;
    else cout<<1<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<complex>
#define EPS 1e-10
using namespace std;

typedef complex<double>P;

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		double ra,rb;
		P pa,pb;
		
		cin>>pa.real()>>pa.imag()>>ra;
		cin>>pb.real()>>pb.imag()>>rb;
		double d=abs(pa-pb);
		if(d<rb-ra)cout<<-2<<endl;
		else if(d<ra-rb)cout<<2<<endl;
		else if(d<=ra+rb)cout<<1<<endl;
		else cout<<0<<endl;
	}
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define rep2(i,from,to) for(int i=(from); i<(to); ++(i))
#define rep(i,to) rep2(i,0,to)
int main() {
	int n;
	cin >> n;
	while(n--) {
		double x[2], y[2], r[2];
		double EPS = 1e-10;
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		if(pow(x[1] - x[0], 2.0) + pow(y[1] - y[0], 2.0) - pow(r[1] + r[0], 2.0) > EPS) {
			cout << "0" << endl;
		} else {
			if(r[1] - r[0] - sqrt(pow(x[1] - x[0], 2.0) + pow(y[1] - y[0], 2.0)) > EPS) {
				cout << "-2" << endl;
			} else if(r[0] - r[1] - sqrt(pow(x[1] - x[0], 2.0) + pow(y[1] - y[0], 2.0)) > EPS) {
				cout << "2" << endl;
			} else cout << "1" << 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((x1-x2)*(x1-x2) + (y1-y2)*(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<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r =pow(xb - xa, 2.0) + pow(yb - ya, 2.0);
		if (sqrt(r) > ra + rb) {
			cout << 0 << endl;
		}
		else if (sqrt(r) <ra-rb){
			cout << 2 << endl;
		}
		else if (sqrt(r) < rb - ra) {
			cout << -2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}

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

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

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#define EPS 0.000000001
using namespace std;

double X[2][60],Y[2][60],R[2][60];
int res[60];
int main(){
	int N;
	cin>>N;
	for(int i=1;i<=N;i++){
		for(int j=0;j<2;j++){
			cin>>X[j][i]>>Y[j][i]>>R[j][i];
		}
	}

	double re;
	for(int i=1;i<=N;i++){
		re=pow(X[0][i]-X[1][i],2)+pow(Y[0][i]-Y[1][i],2);
		if(re>pow(R[0][i]+R[1][i],2)){
			res[i]=0;
		}
		else if(re>pow(R[0][i]-R[1][i],2)){
			res[i]=1;
		}
		else if(R[0][i]>R[1][i]){
			res[i]=2;
		}
		else res[i]=-2;
	}
	for(int i=1;i<=N;i++){
		cout<<res[i]<<endl;
	}
	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-3;

#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(d , r1-r2) && GE(d , r2-r1)) return 1;
  else if(GE(r1 , r2)) return 2;
  else return -2;
  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 <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
signed main(void){
	ios::sync_with_stdio(false);
	int T;
	cin>>T;
	double x1,x2,y1,y2,r1,r2,d;
	for(int t=1;t<=T;t++){
		cin>>x1>>y1>>r1
		   >>x2>>y2>>r2;
		d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		if(d-(r1+r2)>=1e-10)
			cout<<0<<endl;
		else if(d-fabs(r1-r2)<=1e-10){
			if(r1>r2)
				cout<<2<<endl;
			else
				cout<<-2<<endl;
		}
		else
			cout<<1<<endl;
	}
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
typedef long long int ll;
double ab(double a){
	if(a>=0)return a;
	return -a;
}
int main()
{
	int n;
    double xa,ya,ra,xb,yb,rb;
	cin >> n;
	for(int i=0;i<n;i++){
	cin >> xa >> ya >> ra >> xb >> yb >> rb;
	double a=sqrt((yb-ya)*(yb-ya)+(xb-xa)*(xb-xa));
	if(a>ra+rb){
		printf("0\n");
	}
	else if(ab(ra-rb)<a){
		printf("1\n");
	}
	else if(ra>rb)printf("2\n");
	else printf("-2\n");
	}
    return 0;
}