#include #include #include #include #include using namespace std; using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(int i=0; i<(int)(n); i++) struct Vec2{ i64 x,y; Vec2 operator+(Vec2 r) const { return { x+r.x, y+r.y }; } Vec2 operator-() const { return { -x, -y }; } Vec2 operator-(Vec2 r) const { return { x-r.x, y-r.y }; } static i64 dot(Vec2 l, Vec2 r){ return l.x*r.x + l.y*r.y; } static i64 cross(Vec2 l, Vec2 r){ return l.x*r.y - l.y*r.x; } // l // ^ // + | - // <-|-> r }; struct ArgRange{ Vec2 l = {0,0}; Vec2 r = {0,0}; }; int N; vector X; vector> argranges; void enum_argranges(){ map argranges_map; rep(a,N) rep(b,N) if(a != b){ u64 mask = 0; rep(c,N){ auto ab = X[b] - X[a]; auto ac = X[c] - X[a]; auto crossbc = Vec2::cross(ab, ac); auto dotbc = Vec2::dot(ab, ac); if(0 > crossbc) mask |= ((u64)1) << c; if(crossbc == 0 && 0 >= dotbc) mask |= ((u64)1) << c; } argranges_map[mask].r = X[b] - X[a]; } rep(a,N) rep(b,N) if(a != b){ u64 mask = 0; rep(c,N){ auto ab = X[b] - X[a]; auto ac = X[c] - X[a]; auto crossbc = Vec2::cross(ab, ac); auto dotbc = Vec2::dot(ab, ac); if(0 < crossbc) mask |= ((u64)1) << c; if(crossbc == 0 && 0 >= dotbc) mask |= ((u64)1) << c; } argranges_map[mask].l = X[a] - X[b]; } argranges.assign(argranges_map.begin(), argranges_map.end()); } int main(){ cin >> N; X.resize(N); rep(i,N) cin >> X[i].x >> X[i].y; rep(i,N) X[i] = X[i] + Vec2{ 1,1 }; if(N == 1){ cout << "2\n"; return 0; } if(N == 2){ cout << "4\n"; return 0; } enum_argranges(); /* for(auto [mask, r] : argranges){ for(int d=0; d>d) & 1); cout << " : "; cout << "( ( " << r.l.x << ", " << r.l.y << " ) , " << "( " << r.r.x << ", " << r.r.y << " ) )" << endl; } */ set ans; ans.insert((((u64)1) << N) - 1); for(auto a : argranges) ans.insert(a.first); for(auto a : argranges) for(auto b : argranges) ans.insert(a.first & b.first); int argn = argranges.size(); vector overrange(argn, 0); rep(a,argn) if(Vec2::cross(argranges[a].second.l, argranges[a].second.r) < 0) overrange[a] |= 1; auto cancont = [](ArgRange a, ArgRange b) -> bool { if(Vec2::cross(a.l, b.l) > 0) return true; if(Vec2::cross(a.r, b.l) > 0) return true; if(Vec2::cross(a.l, b.r) > 0) return true; if(Vec2::cross(a.r, b.r) > 0) return true; return false; }; rep(a,argn) rep(b,argn) rep(c,argn){ auto A = argranges[a].second; auto B = argranges[b].second; auto C = argranges[c].second; if(!overrange[a] && !overrange[b] && !cancont(A, B)) continue; if(!overrange[b] && !overrange[c] && !cancont(B, C)) continue; if(!overrange[c] && !overrange[a] && !cancont(C, A)) continue; ans.insert(argranges[a].first & argranges[b].first & argranges[c].first); } cout << ans.size() << '\n'; return 0; }