-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1002.cpp
More file actions
34 lines (27 loc) · 688 Bytes
/
Copy path1002.cpp
File metadata and controls
34 lines (27 loc) · 688 Bytes
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
#include <iostream>
using namespace std;
int dot(int x1, int y1, int r1, int x2, int y2, int r2){
if((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)<(r1-r2)*(r1-r2)){
return 0;
}
else if((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)==(r1-r2)*(r1-r2)){
if(r1-r2==0) return -1;
return 1;
}
else if((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)<(r1+r2)*(r1+r2)){
return 2;
}
else if((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)==(r1+r2)*(r1+r2)){
return 1;
}
else return 0;
}
int main(){
int n, x1, y1, r1, x2, y2, r2;
cin>>n;
for(int i=0; i<n; i++){
cin>>x1>>y1>>r1>>x2>>y2>>r2;
cout<<dot(x1,y1,r1,x2,y2,r2)<<endl;
}
return 0;
}