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

C++: #include<iostream>
#include<math.h>
using namespace std;

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 rsum = (ra+rb)*(ra+rb), rdiff = ra-rb;
        ra-rb < 0 ? rdiff = -rdiff*rdiff : rdiff = rdiff*rdiff;
        double cntr_dst = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
        if(rdiff>cntr_dst){
            cout << 2;
        }else{
            if(-rdiff>cntr_dst){
                cout << -2;
            }
            if(rsum>cntr_dst && cntr_dst>fabs(rdiff)){
                cout << 1;
            }
            if(rsum<cntr_dst){
                cout << 0;
            }
        }
        cout << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(void){
  int n;
  double xa, ya, ra, xb, yb, rb, d;

  cin >> n;
  for(int i = 0;i < n; i++){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    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 << "0" << endl;
    else if(d >= ra - rb) cout << "1" << endl;
  }

}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

double getDistance(double xa, double ya, double xb, double yb) {
    return sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
}

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

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

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

int main() {
    int n;
    double xa, ya, ra, xb, yb, rb;
    std::cin >> n;
    
    while(n--){
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double dis = distance(xa, ya, xb, yb);;
        if(dis + rb < ra)
            std::cout << "2" << std::endl;
        else if(dis + ra < rb)
            std::cout << "-2" << std::endl;
        else if(dis == ra + rb)
            std::cout << "1" << std::endl;
        else
            std::cout << "0" << std::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(void){
	int n = 0;
	float xa, ya, ra, xb, yb, rb;
	float d =0.0;
	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%f %f %f %f %f %f",
			&xa, &ya, &ra, &xb, &yb, &rb);
		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));

		if(d > ra+rb){
			puts("0");
		}else if(ra >= d+rb){
			puts("2");
		}else if(rb >= d+ra){
			puts("-2");
		}else{
			puts("1");
		}
	}
	return 0;
}

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 = pow(dis,0.5);
       if(dis>ra+rb){
printf("%d\n",0);
continue;}
else if(dis<fabs(ra-rb)){
	if(ra>rb){
printf("%d\n",2);
	}else{
		printf("%d\n",2);
	}
}else{
	printf("%d\n",1);
}
}
return 0;
}

C++: /* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 
                                                           
*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define print(x) cout << x << '\n'
#define Fi first
#define Se second

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define DEPS(i, a, n) for (int i = (a); i >= n; i--)
#define DEP(i, n) for (int i = (n); i >= 0; i--)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* const */
const int INF = 999999999;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool is_uruu(int y) {return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;}
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}

/* }}} */

#define sq(x) ((x) * (x))

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;

  while (n--){
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(sq(xa - xb) + sq(ya - yb));

    if (d < fabs(rb - ra)){
      print("2");
    } else if (d < fabs(ra - rb)){
      print("-2");
    } else if (fabs(ra - rb) <= d && d <= ra + rb){
      print("1");
    } else {
      print("0");
    }
  }

  return 0;
}