#include typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define RANGE(vec) (vec).begin(),(vec).end() using namespace std; class ThrowOneYenCoin { public: static const int r = 10; typedef pair Pt; bool hit(const Pt &a, const Pt &b) { int ax,ay,bx,by; tie(ax,ay) = a; tie(bx,by) = b; return (ax-bx)*(ax-bx)+(ay-by)*(ay-by) < 4*r*r; } void solve(void) { int N; cin>>N; const int B = 100; const int maxX = 20000; const int maxY = 20000; const int maxBX = maxX/B; const int maxBY = maxY/B; list field[maxBY+1][maxBX+1]; // 100*100 に含まれるコインの数は最大25程度 // O(N*9*25) REP(i,N) { int x,y; cin>>x>>y; Pt p(x,y); int bx = x/B; int by = y/B; int dx[] = {-1,0,1}; int dy[] = {-1,0,1}; bool ok = true; REP(j,3) REP(k,3) { int nx = bx+dx[j]; int ny = by+dy[k]; if (nx < 0 || ny < 0 || maxBX < nx || maxBY < ny) continue; auto &f = field[ny][nx]; for (auto c : f) { if ( hit(c,p) ) ok = false; } } if (ok) field[by][bx].push_back(p); } ll cnt = 0; REP(i,maxBX+1) REP(j,maxBY+1) { auto &f = field[j][i]; cnt += f.size(); } cout<solve(); delete obj; return 0; } #endif