Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- #include <numeric>
- #include <algorithm>
- #include <string>
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- long double x1, y1, x2, y2, x3, y3, x4, y4;
- cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
- long double ca[2]={(x1+x2)/2,(y1+y2)/2};
- long double cb[2]={(x3+x4)/2,(y3+y4)/2};
- long double ra=sqrt(pow((ca[0]-x2),2)+pow((ca[1]-y2),2));
- long double rb=sqrt(pow((cb[0]-x4),2)+pow((cb[1]-y4),2));
- long double cc=sqrt(pow((ca[0]-cb[0]),2)+pow((ca[1]-cb[1]),2));
- if (cc<ra+rb) cout << "YES";
- else cout << "NO";
- return 0;
- }
- /*
- *
- */
Advertisement
Add Comment
Please, Sign In to add comment