fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x1, y1, x2, y2, x3, y3;
  6. cin>>x1>>y1>>x2>>y2>>x3>>y3;
  7. int S=x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);
  8. if (S==0)
  9. cout<<"YES";
  10. else
  11. cout<<"NO";
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5292KB
stdin
1
1
2
2
3
3
stdout
YES