lina_os

Untitled

Feb 6th, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. #include <numeric>
  5. #include <algorithm>
  6. #include <string>
  7.  
  8. using namespace std;
  9.  
  10. int main() {
  11. ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  12. long double x1, y1, x2, y2, x3, y3, x4, y4;
  13. cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
  14. long double ca[2]={(x1+x2)/2,(y1+y2)/2};
  15. long double cb[2]={(x3+x4)/2,(y3+y4)/2};
  16. long double ra=sqrt(pow((ca[0]-x2),2)+pow((ca[1]-y2),2));
  17. long double rb=sqrt(pow((cb[0]-x4),2)+pow((cb[1]-y4),2));
  18. long double cc=sqrt(pow((ca[0]-cb[0]),2)+pow((ca[1]-cb[1]),2));
  19. if (cc<ra+rb) cout << "YES";
  20. else cout << "NO";
  21. return 0;
  22. }
  23.  
  24. /*
  25. *
  26. */
Advertisement
Add Comment
Please, Sign In to add comment