Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define pb push_back
- bool valid(int x1, int x2, int x3, int y1, int y2, int y3)
- {
- int a = (x1-x2)*(y2-y3);
- int b = (x2-x3)*(y1-y2);
- //if((int)floor(a)==(int)floor(b) && (int)ceil(a)==(int)ceil(b) ) return true;
- if(a==b) return true;
- return false;
- }
- int main()
- {
- int t;
- cin >> t;
- vector< pair< int, int > > v;
- int n = t;
- while(t--) {
- int a, b;
- cin >> a >> b;
- v.pb({a, b});
- }
- //cout << 3 << endl;
- int cnt = 0, mx = 0;
- int i, j, k;
- for(i=0; i<n-2; i++) {
- for(j=i+1; j<n-1; j++) {
- for(k=j+1; k<n; k++) {
- if(valid(v[i].first, v[j].first, v[k].first, v[i].second, v[j].second, v[k].second)){
- cnt++;
- }
- }
- mx = max(mx, cnt);
- }
- }
- //cout << mx << endl;
- if(mx>=1) cout << "Yes\n";
- else cout << "No\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement