#include // #include #define rng(a) a.begin(),a.end() #define rrng(a) a.rbegin(),a.rend() #define INF 2000000000000000000 #define ll long long #define ull unsigned long long #define ld long double #define pll pair using namespace std; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> N; vector X(N), Y(N); for (ll i = 0; i < N; ++i) { cin >> X.at(i) >> Y.at(i); } //y = ax + b //gradient = a = dy / dx //{dx, dy} vector> gradient(N); for (ll i = 0; i < N; ++i) { for (ll j = 0; j < N; ++j) { if (i == j) { continue; } ll dx = X.at(i) - X.at(j), dy = Y.at(i) - Y.at(j); if (dx == 0) { if (dy >= 0) { gradient.at(i).push_back({INF, 0}); } else { gradient.at(i).push_back({-INF, 0}); } } else { // if (dx < 0) { // dx = -dx; // dy = -dy; // } ll gcd = abs(__gcd(dx, dy)); gradient.at(i).push_back({dx / gcd, dy / gcd}); } } } ll ans = 0; for (ll i = 0; i < N; ++i) { sort(rng(gradient.at(i))); // cout << "i" << i << "\n"; // for (ll j = 0; j < gradient.at(i).size(); ++j) { // cout << gradient.at(i).at(j).first << " " << gradient.at(i).at(j).second << "\n"; // } // cout << "\n"; for (ll j = 0; j < (ll)gradient.at(i).size() - 1; ++j) { if (gradient.at(i).at(j) == gradient.at(i).at(j + 1)) { ans += 1; break; } } } cout << ans << "\n"; }