#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) struct P { int x, y; P(){}; P(int _x, int _y): x(_x), y(_y){}; }; int N,T; vector M[1111][1111]; vector

ps; int distance2(P a, P b) { return pow(a.x - b.x, 2) + pow(a.y - b.y, 2); } signed main() { cin >> N; int ans = 0; int x,y; REP(i,N) { cin >> x >> y; ps.push_back(P(x, y)); int mx = ps[i].x / 20; int my = ps[i].y / 20; int dxy9[] = {-1, 0, 1}; bool ok = true; REP(k,9) { int nx = mx + dxy9[k/3]; int ny = my + dxy9[k%3]; if (nx<0||ny<0) continue; for (auto&& j : M[nx][ny]) { if (distance2(ps[j], ps[i]) < 400) { // conflict ok = false; break; } } if (!ok) break; } if (ok) { M[mx][my].push_back(i); ans++; } } cout << ans << endl; return 0; }