// #define MULTEST #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace kod { namespace util { template class fixed_point : private F { constexpr fixed_point(F&& f) noexcept : F(std::forward(f)) {} template friend constexpr decltype(auto) make_fixed(G&&) noexcept; public: template constexpr decltype(auto) operator()(Args&&... args) const noexcept { return F::operator()(*this, std::forward(args)...); } }; template [[nodiscard]] constexpr decltype(auto) make_fixed(G&& g) noexcept { using F = std::decay_t; return fixed_point(std::forward(g)); } } // namespace util } // namespace kod namespace kod { namespace util { class forward_loop { int x, y; constexpr forward_loop(int x, int y) noexcept : x(x), y(y) {} friend constexpr forward_loop rep(int, int) noexcept; friend constexpr forward_loop rep(int) noexcept; public: constexpr forward_loop begin() const noexcept { return *this; } constexpr std::monostate end() const noexcept { return {}; } constexpr bool operator!=(std::monostate) const noexcept { return x < y; } constexpr void operator++() const noexcept {} constexpr int operator*() noexcept { return x++; } }; [[nodiscard]] constexpr forward_loop rep(int l, int r) noexcept { return forward_loop(l, r); } [[nodiscard]] constexpr forward_loop rep(int n) noexcept { return forward_loop(0, n); } class backward_loop { int x, y; constexpr backward_loop(int x, int y) noexcept : x(x), y(y) {} friend constexpr backward_loop revrep(int, int) noexcept; friend constexpr backward_loop revrep(int) noexcept; public: constexpr backward_loop begin() const noexcept { return *this; } constexpr std::monostate end() const noexcept { return {}; } constexpr bool operator!=(std::monostate) const noexcept { return x > y; } constexpr void operator++() const noexcept {} constexpr int operator*() noexcept { return --x; } }; [[nodiscard]] constexpr backward_loop revrep(int l, int r) noexcept { return backward_loop(r, l); } [[nodiscard]] constexpr backward_loop revrep(int n) noexcept { return backward_loop(n, 0); } template constexpr void repeat(int n, const F& f) noexcept { assert(n >= 0); while (n--) f(); } } // namespace util } // namespace kod namespace kod { namespace util { namespace stdio_impl { template T scan() { T x; std::cin >> x; return x; } struct scan_any { template operator T() const { return scan(); } }; } // namespace stdio_impl template decltype(auto) scan() { if constexpr (std::is_same_v) return stdio_impl::scan_any{}; else return stdio_impl::scan(); } template std::array scan_arr() { std::array a; for (auto& x : a) x = scan(); return a; } template std::vector scan_vec(int n) { if (n == -1) n = scan(); assert(n >= 0); std::vector v; v.reserve(n); while (n--) v.push_back(scan()); return v; } void flush() { std::cout << std::flush; } void print() {} template void print(const T& x, const Args&... args) { std::cout << x; if (sizeof...(args) != 0) std::cout << ' '; print(args...); } template void println(const Args&... args) { print(args...); std::cout << '\n'; } template void print_seq(const C& c, const char* sep = " ", const char* end = "\n") { bool f = false; for (const auto& x : c) { if (f) std::cout << sep; else f = true; std::cout << x; } std::cout << end; } } // namespace util } // namespace kod namespace kod { namespace sol { using ll = long long; using uint = unsigned; using ull = unsigned long long; using std::array; using std::pair; using std::string; using std::tuple; using std::vector; using namespace util; constexpr int inf = std::numeric_limits::max() / 2; constexpr ll infll = std::numeric_limits::max() / 2; constexpr ll floor_div(ll x, ll y) noexcept { assert(y != 0); return x / y - ((x ^ y) < 0 && x % y != 0); } constexpr ll ceil_div(ll x, ll y) noexcept { assert(y != 0); return x / y + ((x ^ y) >= 0 && x % y != 0); } template constexpr bool setmin(T& lhs, const T& rhs) noexcept { if (lhs > rhs) { lhs = rhs; return true; } return false; } template constexpr bool setmax(T& lhs, const T& rhs) noexcept { if (lhs < rhs) { lhs = rhs; return true; } return false; } void run(); } // namespace sol } // namespace kod int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout << std::fixed << std::setprecision(20); int cases = 1; #ifdef MULTEST std::cin >> cases; #endif while (cases--) kod::sol::run(); return 0; } #ifdef KOD_LOCAL #define OJ_LOCAL(a, b) b #include #else #define OJ_LOCAL(a, b) a #define DBG(...) #define SHOW(...) #endif namespace kod { namespace sol { void run() { const int n = scan(); vector x(n), y(n); for (const int i : rep(n)) { x[i] = scan(); y[i] = scan(); } std::map, std::map<__int128_t, int>> map; for (const int i : rep(n)) { for (const int j : rep(i)) { ll a = x[j] - x[i]; ll b = y[j] - y[i]; ll g = std::gcd(a, b); a /= g, b /= g; ll c = (__int128_t)(-b) * x[i] + (__int128_t)(+a) * y[i]; auto t1 = std::make_tuple(-b, +a, +c); auto t2 = std::make_tuple(+b, -a, -c); auto& v = map[std::min(t1, t2)]; v[(__int128_t)a * x[i] + (__int128_t)b * y[i]] = i; v[(__int128_t)a * x[j] + (__int128_t)b * y[j]] = j; } } vector ans(n); for (const auto& [t, m] : map) { int l = 0, r = (int)m.size(); for (const auto& [v, i] : m) { r -= 1; if (l > 1 || r > 1) { ans[i] = 1; } l += 1; } } println(std::accumulate(ans.begin(), ans.end(), 0)); } } // namespace sol } // namespace kod