fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t, r, x1, x2, x3, y1, y2, y3, count;
  7. cin>>t;
  8. while(t--) {
  9. cin>>r>>x1>>y1>>x2>>y2>>x3>>y3;
  10. count=0;
  11. if((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)<=r*r) count++;
  12. if((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3)<=r*r) count++;
  13. if((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1)<=r*r) count++;
  14. if(count>1) cout<<"yes"<<endl;
  15. else cout<<"no"<<endl;
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 3344KB
stdin
3
1
0 1
0 0
1 0
2
0 1
0 0
1 0
2
0 0
0 2
2 1
stdout
yes
yes
no