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<iostream>
#include<iomanip>
#include<memory>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>

using namespace std;

int main()
{
  int n;
  double xa, ya, ra, xb, yb, rb, pp;

  cin >> n;

  for ( int i = 0; i < n; ++i )
    {
      cin >> xa >> ya >> ra >> xb >> yb >> rb;

      pp = sqrt( (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) );

      if ( pp >= ra + rb )
        cout << 0 << endl;
      else if ( ra >= pp + rb )
        cout << 2 << endl;
      else if ( rb >= pp + ra )
        cout << -2 << endl;
      else
        cout << 1 << endl;
    }
  
  return 0;
}

C++: #include<iostream>
#include<complex>
#define EPS 1e-5
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+ra-rb<=EPS)cout<<-2<<endl;
		else if(d+rb-ra<=EPS)cout<<2<<endl;
		else if(d-ra-rb<=EPS)cout<<1<<endl;
		else cout<<0<<endl;
	}
}

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

using namespace std;

int check(double *l, double *s);

int main()
{
	int n, ans;
	double a[3], b[3];	//[0]:x[1]:y[2]:r

	cin >> n;

	for (int i=0; i<n; i++)
	{
		cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];

		if(a[2] > b[2]) {		//aを大きい円、bを小さい円としたとき
			ans = check(&a[0], &b[0]);
		}
		else {					//bを大きい円、aを小さい円としたとき
			ans = check(&b[0], &a[0]);
			ans *= (ans == 2) ? -1 : 1;		//aがbの中にあるときの処理
		}

		cout << ans << endl;
	}

	return 0;
}

int check(double *l, double *s)	//円の重なり・内外を判定
{
	double d = (l[0]-s[0])*(l[0]-s[0]) + (l[1]-s[1])*(l[1]-s[1]);

	d = sqrt(d);

	if(d <= l[2]-s[2]) {	//小さい円が大きい円の内側にあるとき
		return 2;
	}
	else if(l[2]-s[2] < d && d <= l[2]+s[2]) {	//円周が交わっているとき
		return 1;
	}
	else {
		return 0;	//外側にあるとき
	}
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
#ifdef _MSC_VER
const bool test = true;
#else 
const bool test = false;
#endif

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;

double a[3];
double b[3];

int solve() {
	double diff = hypot(a[0] - b[0], a[1] - b[1]);
	if (diff + b[2] < a[2]) return 2;
	if (diff + a[2] < b[2]) return -2;
	if (a[2] + b[2] >= diff) return 1;
	return 0;
}

int main() {
	int N;
	cin >> N;
	while (cin >> a[0]) {
		rep(i, 2) cin >> a[i + 1];
		rep(i, 3) cin >> b[i];
		cout << solve() << 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 ax,ay,ar,bx,by,br;
		cin >> ax >> ay >> ar >> bx >> by >> br;
		double dd = (ax-bx)*(ax-bx) + (ay-by)*(ay-by);
		double rsum = (ar+br)*(ar+br);
		double rdiff = (ar-br)*(ar-br);
		if (dd > rsum)
			cout << 0 << endl;
		else if (dd <= rsum && dd > rdiff)
			cout << 1 << endl;
		else
			cout << (ar > br ? 2 : -2) << endl;
	}
	return 0;
}

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

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

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

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		float xa, ya, ra, xb, yb, rb, sr, dr;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		complex<float> comp(xa - xb, ya - yb);
		float d = abs(comp);
		sr = ra + rb;
		if(ra < rb){
			dr = rb - ra;
		}
		else{
			dr = ra - rb;
		}
		if(d > sr){
			cout << 0 << endl;
		}
		else if(d < sr && dr < d){
			cout << 1 << endl;
		}
		else if(d < dr){
			if(rb < ra){
				cout << 2 << endl;
			}
			else if(ra < rb){
				cout << -2 << endl;
			}
		}
	return 0;
	}
}

C++: #include <stdio.h>
#include <math.h>
int main() {int N;double x1,x2,y1,y2,r1,r2;scanf("%d",&N);while (N--) {scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&r1,&x2,&y2,&r2);double a1,a2=-2.00;if (r1>r2) a1=x1,x1=x2,x2=a1,a1=y1,y1=y2,y2=a1,a2=2.00,a1=r1,r1=r2,r2=a1;a1=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));if (a1>r1+r2) puts("0");else if (a1<r2) {if (a1+r1<r2) printf("%.0lf\n",a2); else puts("0");} else puts("1");} return 0;}

C++: #include <iostream>
//#include <algorithm>
#include "math.h"

using namespace std;

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

C++: #include<iostream>
#include<cmath>
#define REP(i,s,n) for(int i=0;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace  std;

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

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int n;
double xa, ya, ra, xb, yb, rb;

double dist(double x1, double x2, double y1, double y2) {
	double dx = xa - xb;
	double dy = ya - yb;
	return sqrt(dx*dx + dy*dy);
}

int main() {
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

		double dist_ab = dist(xa, ya, xb, yb);

		if (dist_ab < ra) {
			if (dist_ab + rb < ra) {
				cout << "2" << endl;
			} else {
				cout << "1" << endl;
			}
		} else if (dist_ab < rb) {
			if (dist_ab + ra < rb) {
				cout << "-2" << endl;
			} else {
				cout << "1" << endl;
			}
		} else if (dist_ab <= ra + rb) {
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/