Advertisement
semsem_elazazy

T. Two Lines

Mar 4th, 2022
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. #define ll long long
  4. #define ull unsigned long long
  5. using namespace std;
  6.  
  7.  
  8. int main() {
  9.    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  10.  
  11. long double x1,y1,x2,y2;
  12. cin>>x1>>y1>>x2>>y2;
  13. long double a1,b1,a2,b2;
  14. cin>>a1>>b1>>a2>>b2;
  15. long double m1=(y2-y1)/(x2-x1);
  16. long double m2=(b2-b1)/(a2-a1);
  17. if(m1==m2) cout<<"YES";
  18. else       cout<<"NO";
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement