// http://kmjp.hatenablog.jp/entry/2014/12/15/1000 #include #include #include #include using ll = long long; using namespace std; #define FOR(i, N) for (int i = 0; i < (int)(N); i++) int N; vector x, y; long long count() { int i, j; ll ret = 0; double pi = atan(1) * 4; N = x.size(); vector V; FOR(i, N) { double d = atan2(y[i], x[i]); if (d < 0) d += 2 * pi; V.push_back(d); cerr << d << endl; } sort(V.begin(), V.end()); FOR(i, N) for (j = i + 1; j < N; j++) { if (V[j] < V[i] + pi) { int x2 = lower_bound(V.begin(), V.end(), V[i] + pi + 1e-15) - V.begin(); int y2 = lower_bound(V.begin(), V.end(), V[j] + pi - 1e-15) - V.begin(); ret += max(0, y2 - x2); // cerr << max(0, y2 - x2) << endl; } } return ret; } int main() { cin >> N; FOR(i, N) { int u, v; cin >> u >> v; x.emplace_back(u); y.emplace_back(v); } cout << count() << endl; }