Advertisement
Asif_Anwar

Untitled

Nov 1st, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define ll long long
  5. #define pb push_back
  6.  
  7. bool valid(int x1, int x2, int x3, int y1, int y2, int y3)
  8. {
  9. int a = (x1-x2)*(y2-y3);
  10. int b = (x2-x3)*(y1-y2);
  11. //if((int)floor(a)==(int)floor(b) && (int)ceil(a)==(int)ceil(b) ) return true;
  12. if(a==b) return true;
  13. return false;
  14. }
  15.  
  16. int main()
  17. {
  18. int t;
  19. cin >> t;
  20. vector< pair< int, int > > v;
  21. int n = t;
  22. while(t--) {
  23. int a, b;
  24. cin >> a >> b;
  25. v.pb({a, b});
  26. }
  27. //cout << 3 << endl;
  28. int cnt = 0, mx = 0;
  29. int i, j, k;
  30. for(i=0; i<n-2; i++) {
  31. for(j=i+1; j<n-1; j++) {
  32. for(k=j+1; k<n; k++) {
  33. if(valid(v[i].first, v[j].first, v[k].first, v[i].second, v[j].second, v[k].second)){
  34. cnt++;
  35. }
  36. }
  37. mx = max(mx, cnt);
  38. }
  39. }
  40. //cout << mx << endl;
  41. if(mx>=1) cout << "Yes\n";
  42. else cout << "No\n";
  43. return 0;
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement