#include #include #include #include using namespace std; typedef tuple P; #define g(a, t) get(a) int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector x(N), y(N); for(int i = 0; i < N; i++) cin >> x[i] >> y[i]; priority_queue, greater

> q; for(int i = 0; i < N; i++){ for(int j = i + 1; j < N; j++){ long long temp = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]); q.push(P(temp, i, j)); } } vector used(N); int cnt = 0; while(!q.empty()){ P t = q.top(); q.pop(); int s1 = g(t, 1), s2 = g(t, 2); if(used[s1] == 1 || used[s2] == 1) continue; else if(s1 == 0){ used[s2] = 1; cnt++; } else if(s2 == 0){ used[s1] = 1; cnt++; } else{ used[s1] = 1; used[s2] = 1; } } cout << cnt << endl; }