-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1002.cpp
44 lines (41 loc) · 854 Bytes
/
1002.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdio.h>
#include <string>
#include <string.h>
#include <vector>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#pragma warning(disable:4996)
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int x1, y1, r1, x2, y2, r2;
cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
double d = sqrt(pow((x1 - x2), 2) + pow((y1 - y2), 2));
if (r1 + r2 < d) {
printf("0\n");
}
else if (abs(r1 - r2) > d) {
printf("0\n");
}
else if (d == 0 && r1 == r2) {
printf("-1\n");
}
else if (d == (r1 + r2)) {
printf("1\n");
}
else if (d == abs(r1 - r2)) {
printf("1\n");
}
else {
printf("2\n");
}
}
return 0;
}