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 <array>
#include <math.h>

int main(){

	std::array<double, 3> a; //0:xa 1:ya 2:ra
	std::array<double, 3> b;

	int N;

	std::cin >> N;

	for(int i = 0; i < N; ++i){
		
		for(int j = 0; j < 3; ++j)
			std::cin >> a[j];

		for(int j = 0; j < 3; ++j)
			std::cin >> b[j];

		double ab = hypot( (a[0] - b[0]) + (a[1] - b[1]) );

		if( ab > (a[2] + b[2]) )
			std::cout << 0 << std::endl;
		
		else if ( a[2] > ab + b[2] )
			std::cout << 2 << std::endl;

		else if ( b[2] > ab + a[2] )
			std::cout << -2 << std::endl;

		else
			std::cout << 1 << std::endl;

	}
	
	return 0;

}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
double pitagoras(double x1,double y1,double x2,double y2){
  return (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);
    ra*=ra;
    rb*=rb;
    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 <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;
}