fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. double x1, y1, r1, x2, y2, r2; cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
  6.  
  7. double distance = sqrt(pow(x1-x2, 2) + pow(y1-y2, 2));
  8. if (distance > r1+r2) cout << "NO";
  9. else if (distance <= r1+r2) cout << "YES";
  10. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
YES