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)
		distance := math.Sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya))
		if rb+distance < ra {
			fmt.Println(2)
		} else if ra+distance < rb {
			fmt.Println(-2)
		} else if rb+ra >= distance {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

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

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-6

double sqr(double x, double y){
	return x*x + y*y;
}
int main(){
	int n;
	double xa,ya,ra,xb,yb,rb;
	scanf("%d",&n);
	rep(i,n){
		scanf("%lf %lf %lf %lf %lf %lf",
					&xa,&ya,&ra,&xb,&yb,&rb);
		double z = sqr(xa-xb,ya-yb);
		//printf("z:%lf   ra+rb:%lf\n",z,ra+rb);
		if( z > (ra+rb)*(ra+rb) ){
			puts("0");
		}else{
			if( z>ra*ra && z>rb*rb ){
				puts("1");
			}else if( 0>z-(ra*ra) ){
				puts("2");
			}else{
				puts("-2");
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
 
int main()
{
	int n;
	cin >> n;
	while( n-- > 0){
		double xa,ya,ra,xb,yb,rb;
		cin >> xa >> xb >> ra >> xb >> yb >> rb;
		double ab = sqrt(pow(xb-xa, 2.0) + pow(yb-ya, 2.0));
		if(ab > ra+rb){ 
			cout << 0 << endl;
		}else if(ab >= abs(ra-rb) ){
			cout << 1 << endl;
		}else if(ra > rb){
			cout << 2 << endl;
		}else  {
			cout << -2 << endl;
		}
	}		
	return 0;
}

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

using namespace std;

int main(void){
	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);
		if(sqrt(pow(xb - xa,2.0) + pow(yb - ya,2.0)) + rb < ra){
			printf("2\n");
		}else if(sqrt(pow(xb - xa,2.0) + pow(yb - ya,2.0)) + ra < rb){
			printf("-2\n");
		}else if(sqrt(pow(xb - xa,2.0) + pow(yb - ya,2.0)) <= ra + rb){
			printf("1\n");
		}else{
			printf("0\n");
		}
	}
	return 0;
}

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

int main()
{
  int n;
  while (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((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
      
      if (d > ra+rb)
	cout << "0" << endl;
      else if (d+ra < rb)
	cout << "-2" << endl;
      else if (d+rb < ra)
	cout << "2" << endl;
      else
	cout << "1" << 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 dis = sqrt(pow((xa - xb), 2) - pow((ya - yb), 2));
    if(fabs(ra - rb) >= dis)
      if(ra > rb)
	cout << "2" << endl;
      else
	cout << "-2" << endl;
    else if(fabs(ra - rb) < dis && ra + rb > dis)
      cout << "1" << endl;
    else
      cout << "0" << endl;
  }
}

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+rb)) cout << 0 << endl;
	else cout << 1 << endl; 
	}
	return 0; 
}

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

int solve(double xa, double ya, double ra, double xb, double yb, double rb){
    double distance = sqrt(pow(xa - ya, 2) + pow(ya - yb, 2));
    if (distance > ra + rb) return 0;
    else if (distance < ra - rb) return 2;
    else if (distance < rb - ra) return -2;
    else return 1;
}

int main(){
    double xa, ya, ra, xb, yb, rb;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
	cin >> xa >> ya >> ra >> xb >> yb >> rb;
	cout << solve(xa, ya, ra, xb, yb, rb);
    }
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
double pitagoras(double x1,double y1,double x2,double y2){
  return sqrt((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);
    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<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<list>
#include<queue>
#include<stack>
#include<deque>
using namespace std;

int main() {
	int a; cin >> a;
	for (int b = 0; b < a; b++) {
		double x1, y1, r1, x2, y2, r2;
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		double s = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		if (s+r1 - r2 <= 0.000001) {
			puts("-2");
		}
		else if (r2 + s - r1 <= 0.000001) {
			puts("2");
		}
		else if (s - r2 - r1 <= 0) {
			puts("1");
		}
		else puts("0");
	}
}

C++: #include <iostream>

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 = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
		r1 *= r1;
		r2 *= r2;
		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 <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 {
			cout << "0" << endl;
		}
	}

	return 0;
}

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

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

using namespace std;

int check(double xa,double ya,double ra,double xb,double yb,double rb){
  double dist = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
  double minr = min(ra,rb);
  if(ra+rb<dist){
    return 0;
  }else{
    if(ra>rb&&dist<ra-rb){
      return 2;
    }else if(ra<rb&&dist<rb-ra){
      return -2;
    }else{
      return 1;
    }
  }
}

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;
    cout << check(xa,ya,ra,xb,yb,rb) << endl;
  }
}

C++: //Vol0 0023
#include<stdio.h>
#include<math.h>
int main()
{
	int n,r=0;
	double xa,ya,ra,xb,yb,rb,ht;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		ht=sqrt(((xa-xb)*(xa-xb))+((ya-yb)*(ya-yb)));
		if(ra+rb<ht){
			r=0;
		}else if(ht+rb<ra){
			r=2;
		}else if(ht+ra<rb){
			r=-2;
		}else{
			r=1;
		}
		printf("%d\n",r);
	}
	return 0;
}