#include #include using namespace std; #define DEBUG(x) cerr<<#x<<": "< #define vl vector #define vii vector< vector > #define vll vector< vector > #define vs vector #define pii pair #define pis pair #define psi pair #define pll pair template pair operator+(const pair &s, const pair &t) { return pair(s.first + t.first, s.second + t.second); } template pair operator-(const pair &s, const pair &t) { return pair(s.first - t.first, s.second - t.second); } template ostream& operator<<(ostream& os, pair p) { os << "(" << p.first << ", " << p.second << ")"; return os; } #define X first #define Y second #define rep(i,n) for(int i=0;i<(n);i++) #define rep1(i,n) for(int i=1;i<=(n);i++) #define rrep(i,n) for(int i=(n)-1;i>=0;i--) #define rrep1(i,n) for(int i=(n);i>0;i--) #define REP(i,a,b) for(int i=a;i bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; } #define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end()); const ll inf = 1000000001; const ll INF = (ll)1e18 + 1; const double pi = 3.14159265358979323846; #define Sp(p) cout<> n; vector xy; rep (i, n) { int x,y ; cin >> x >> y; if (x == 0 and y == 0) continue; xy.emplace_back(x, y); } n = xy.size(); sort(all(xy), cmp); const long double eps = 1e-9; vector xy2(2 * n); rep (i, n) { xy2[i] = atan2((long double)xy[i].second, (long double)xy[i].first); if (xy2[i] < 0) xy2[i] += 2 * pi; } rep (i, n) { xy2[n + i] = xy2[i] + 2 * pi; } //DEBUG_VEC(xy); //DEBUG_VEC(xy2); ll ans = 0; rep (i, n) { for (int j = i + 1; j < n; j++) { if (i == j) continue; //DEBUG(pii(i, j)); long double t1 = atan2((long double)xy[i].second, (long double)xy[i].first); long double t2 = atan2((long double)xy[j].second, (long double)xy[j].first); //DEBUG(t1); //DEBUG(t2); if (abs(t1 - t2) <= eps) continue; if (abs(abs(t1 - t2) - pi) <= eps) continue; if (t1 < 0) t1 += 2 * pi; if (t2 < 0) t2 += 2 * pi; t1 = t1 + pi; t2 = t2 + pi; if (t1 >= 2 * pi) t1 -= 2 * pi; if (t2 >= 2 * pi) t2 -= 2 * pi; if (t1 > t2) { swap(t1, t2); } //DEBUG(t1); DEBUG(t2); if (t2 - t1 > pi) { t1 += 2 * pi; swap(t1, t2); } assert(t2 > t1); assert(t2 - t1 < pi); auto itr1 = upper_bound(all(xy2), t1); auto itr2 = lower_bound(all(xy2), t2); ans += itr2 - itr1; } } DEBUG(ans); ans /= 3; cout << ans << endl; }