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>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    double a[3],b[3];
    cin >>a[0]>>a[1]>>a[2]>>b[0]>>b[1]>>b[2];
    double dis = (a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1]);
    if((a[2]+b[2])*(a[2]+b[2]) < dis){cout <<"0"<<endl;}
    else{
      if((a[2]-b[2])*(a[2]-b[2]) > dis){
	if(a[2]>b[2]){cout <<"2"<<endl;}
	else{cout <<"-2"<<endl;}
      }
      else{cout <<"1"<<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);
		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;
    double x1, y1, r1, x2, y2, r2;

    cin >> n;
    while ( n-- ) {
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
        /*
        2 ,原点同士の距離+r1 < r2
        -2,原点同士の距離+r2 < r1
        1 ,原点同士の距離 >= r1 + r2
        0 ,else

        a^2 = b^2 + c^2

        */
        double dx, dy, dis;
        dx = abs(x2-x1);
        dy = abs(y2-y1);
        dis = sqrt(pow(dx, 2) + pow(dy, 2));
        if ( dis + r2 < r1 ) {
            cout << 2;
        } else if ( dis + r1 < r2 ) {
            cout << -2;
        } else if ( r1 + r2 > dis ) {
            cout << 1;
        } else {
            cout << 0;
        }
        cout << 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 ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

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

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

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 ab = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (ab + rb - ra <= EPS) cout << "2" << endl;
		else if (ab + ra - rb <= EPS) cout << "-2" << endl;
		else if (ab - ra - rb >= EPS) cout << "0" << endl;
		else cout << "1" << endl;
	}
	return 0;
}

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

int n, m;
double a, b, p, c, d, q, t;

int main()
{
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> a >> b >> p >> c >> d >> q;

		t = sqrt((a - c) * (a - c) + (b - d) * (b - d));

		if (p + q < t)
			m = 0;
		else if (p - q > t)
			m = 2;
		else if (q - p > t)
			m = -2;
		else
			m = 1;

		cout << m << endl;
	}
}

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

float d(float x, float y, float z, float w){
	float ret;
	ret = pow(x - z, 2) + pow(y - z, 2);
	return sqrtf(ret);
}

int main(){
	int n,c;
	float x[2], y[2], r[2], dd;
	cin >> n;
	for(int i = 0;i<n;i++){
		cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
		dd = d(x[0], y[0], x[1], y[1]);
		if(dd>r[0]+r[1]){
			cout << 0 << endl;
		}
		else{
			if(dd + r[0] < r[1] || dd + r[1] < r[0]){
				cout << 2 << endl;
			}
			else
			{
				cout << 1 << endl;
			}
		}
	}
	return 0;
}

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

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

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	double xa,ya,ra,xb,yb,rb;
	for(int i=0;i<n;i++){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double l = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
		if(l>ra+rb){
			cout<<"0"<<endl;
		}else if(l<rb){
			cout<<"2"<<endl;
		}else if(l<ra){
			cout<<"-2"<<endl;
		}else{
			cout<<"1"<<endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
		
		if(u+r2 < r1){
			cout << "2" << endl;
		} else if(u+r1 < r2){
			cout << "-2" << endl;
		} else if(r1+r2 <= u){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}

C++: #include<iostream>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++)
	{
		long double xa, ya, ra, xb, yb, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		long double d = hypot(xa - xb, ya - yb);
		if (d < abs(ra - rb))
		{
			std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
		}
		else if (d <= ra + rb)
		{
			std::cout << 1 << std::endl;
		}
		else
		{
			std::cout << 0 << std::endl;
		}
	}
	return 0;
}